imaging_api.utils.exceptions

Exceptions

NotFoundError

Exception raised when a resource is not found.

AlreadyExistsError

Exception raised when a resource already exists.

InternalServerError

Exception raised for internal server errors.

LocalStorageError

Exception raised when writing to the imaging-api local filesystem fails.

Module Contents

exception imaging_api.utils.exceptions.NotFoundError(detail: str = 'Resource not found', status_code: int = 404)[source]

Bases: Exception

Exception raised when a resource is not found.

status_code = 404
detail = 'Resource not found'
exception imaging_api.utils.exceptions.AlreadyExistsError[source]

Bases: Exception

Exception raised when a resource already exists.

exception imaging_api.utils.exceptions.InternalServerError(detail: str = 'Internal server error', status_code: int = 500)[source]

Bases: Exception

Exception raised for internal server errors.

status_code = 500
detail = 'Internal server error'
exception imaging_api.utils.exceptions.LocalStorageError(detail: str = 'Local storage error', status_code: int = 500)[source]

Bases: 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.

status_code = 500
detail = 'Local storage error'