imaging_api.utils.exceptions ============================ .. py:module:: imaging_api.utils.exceptions Exceptions ---------- .. autoapisummary:: imaging_api.utils.exceptions.NotFoundError imaging_api.utils.exceptions.AlreadyExistsError imaging_api.utils.exceptions.InternalServerError imaging_api.utils.exceptions.LocalStorageError Module Contents --------------- .. py:exception:: NotFoundError(detail: str = 'Resource not found', status_code: int = 404) Bases: :py:obj:`Exception` Exception raised when a resource is not found. .. py:attribute:: status_code :value: 404 .. py:attribute:: detail :value: 'Resource not found' .. py:exception:: AlreadyExistsError Bases: :py:obj:`Exception` Exception raised when a resource already exists. .. py:exception:: InternalServerError(detail: str = 'Internal server error', status_code: int = 500) Bases: :py:obj:`Exception` Exception raised for internal server errors. .. py:attribute:: status_code :value: 500 .. py:attribute:: detail :value: 'Internal server error' .. py:exception:: LocalStorageError(detail: str = 'Local storage error', status_code: int = 500) Bases: :py:obj:`Exception` Exception raised when writing to the imaging-api local filesystem fails. Distinct from NotFoundError so callers can tell "the remote resource doesn't exist" apart from "our own disk/mount is misconfigured". The former is a user/cohort issue; the latter is an operator/deployment issue and should surface as 500, not 404. .. py:attribute:: status_code :value: 500 .. py:attribute:: detail :value: 'Local storage error'