Skip to content

Exceptions

matchbox.common.exceptions

Custom exceptions for Matchbox.

Classes:

Attributes:

HTTP_EXCEPTION_REGISTRY module-attribute

HTTP_EXCEPTION_REGISTRY: dict[str, type[MatchboxHttpException]] = {(__name__): _67for exc in (_get_all_subclasses(MatchboxHttpException))}

MatchboxExceptionType module-attribute

MatchboxExceptionType = StrEnum('MatchboxExceptionType', _enum_members)

MatchboxException

MatchboxException(message: str | None = None)

Bases: Exception

An exception has occurred in Matchbox..

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxHttpException

MatchboxHttpException(message: str | None = None)

Bases: MatchboxException

Base class for exceptions that can be transmitted over HTTP.

Subclasses must define http_status as a class attribute.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status instance-attribute

http_status: HTTPStatus

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxNameError

MatchboxNameError(message: str)

Bases: MatchboxException, ValueError

Name did not pass validation.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxArrowSchemaMismatch

MatchboxArrowSchemaMismatch(expected: Schema, actual: Schema)

Bases: MatchboxException

Arrow schema mismatch.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxClientSettingsException

MatchboxClientSettingsException(message: str | None = None)

Bases: MatchboxException

Incorrect configuration provided to client.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxUnparsedClientRequest

MatchboxUnparsedClientRequest(message: str | None = None)

Bases: MatchboxException

The API could not parse the content of the client request.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxUnhandledServerResponse

MatchboxUnhandledServerResponse(http_status: int, details: str | None = None)

Bases: MatchboxException

The API sent an unexpected response.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxEmptyServerResponse

MatchboxEmptyServerResponse(message: str | None = None, operation: str | None = None)

Bases: MatchboxException

The server returned an empty response when data was expected.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

operation instance-attribute

operation = operation

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxSourceFieldError

MatchboxSourceFieldError(message: str | None = None)

Bases: MatchboxException

Specified fields diverge with the warehouse.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxSourceClientError

MatchboxSourceClientError(message: str | None = None)

Bases: MatchboxException

Location client must be set.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxSourceExtractTransformError

MatchboxSourceExtractTransformError(logic: str | None = None)

Bases: MatchboxException

Invalid ETL logic detected.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxSourceTableError

MatchboxSourceTableError(message: str | None = None, table_name: str | None = None)

Bases: MatchboxException

Tables not found in your source data warehouse.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

table_name instance-attribute

table_name = table_name

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxServerFileError

MatchboxServerFileError(message: str | None = None)

Bases: MatchboxHttpException

There was a problem with file upload.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 400

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxAuthenticationError

MatchboxAuthenticationError(message: str | None = None)

Bases: MatchboxHttpException

Authentication failed.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 401

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxPermissionDenied

MatchboxPermissionDenied(message: str | None = None, permission: PermissionType | None = None, resource_type: BackendResourceType | None = None, resource_name: str | None = None)

Bases: MatchboxHttpException

User lacks required permission for the requested resource.

Methods:

  • to_details

    Return permission, resource_type and resource_name if set.

Attributes:

http_status class-attribute instance-attribute

http_status = 403

permission instance-attribute

permission = permission

resource_type instance-attribute

resource_type = resource_type

resource_name instance-attribute

resource_name = resource_name

to_details

to_details() -> dict[str, Any] | None

Return permission, resource_type and resource_name if set.

MatchboxUserNotFoundError

MatchboxUserNotFoundError(message: str | None = None, user_name: str | None = None)

Bases: MatchboxHttpException

User not found.

Methods:

Attributes:

http_status class-attribute instance-attribute

http_status = 404

user_name instance-attribute

user_name = user_name

to_details

to_details() -> dict[str, Any] | None

Return user_name if set.

MatchboxResolutionNotFoundError

MatchboxResolutionNotFoundError(message: str | None = None, name: ResolutionName | None = None)

Bases: MatchboxHttpException

Resolution not found.

Methods:

Attributes:

http_status class-attribute instance-attribute

http_status = 404

name instance-attribute

name = name

to_details

to_details() -> dict[str, Any] | None

Return name if set.

MatchboxCollectionNotFoundError

MatchboxCollectionNotFoundError(message: str | None = None, name: CollectionName | None = None)

Bases: MatchboxHttpException

Collection not found.

Methods:

Attributes:

http_status class-attribute instance-attribute

http_status = 404

name instance-attribute

name = name

to_details

to_details() -> dict[str, Any] | None

Return name if set.

MatchboxRunNotFoundError

MatchboxRunNotFoundError(message: str | None = None, run_id: RunID | None = None)

Bases: MatchboxHttpException

Run not found.

Methods:

Attributes:

http_status class-attribute instance-attribute

http_status = 404

run_id instance-attribute

run_id = run_id

to_details

to_details() -> dict[str, Any] | None

Return run_id if set.

MatchboxDataNotFound

MatchboxDataNotFound(message: str | None = None, table: str | None = None, data: list[Any] | None = None)

Bases: MatchboxHttpException

Data doesn’t exist in the Matchbox source table.

Methods:

Attributes:

http_status class-attribute instance-attribute

http_status = 404

table instance-attribute

table = table

data instance-attribute

data = data

to_details

to_details() -> dict[str, Any] | None

Return table and data if set.

MatchboxConnectionError

MatchboxConnectionError(message: str | None = None)

Bases: MatchboxException

Connection to Matchbox’s backend database failed.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxPermissionDeniedError

MatchboxPermissionDeniedError(message: str | None = None)

Bases: MatchboxHttpException

Raised when a user lacks permission for an action.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 403

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxDeletionNotConfirmed

MatchboxDeletionNotConfirmed(message: str | None = None, children: list[str | int] | None = None)

Bases: MatchboxHttpException

Deletion must be confirmed: if certain, rerun with certain=True.

Methods:

Attributes:

http_status class-attribute instance-attribute

http_status = 409

children instance-attribute

children = children

to_details

to_details() -> dict[str, Any] | None

Return children if set.

MatchboxResolutionAlreadyExists

MatchboxResolutionAlreadyExists(message: str | None = None)

Bases: MatchboxHttpException

Resolution already exists.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 409

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxResolutionUpdateError

MatchboxResolutionUpdateError(message: str | None = None)

Bases: MatchboxHttpException

Resolution metadata cannot be updated.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 422

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxResolutionInvalidData

MatchboxResolutionInvalidData(message: str | None = None)

Bases: MatchboxHttpException

Resolution data does not match fingerprint.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 422

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxResolutionExistingData

MatchboxResolutionExistingData(message: str | None = None)

Bases: MatchboxHttpException

Data was already set on resolution.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 409

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxResolutionNotQueriable

MatchboxResolutionNotQueriable(message: str | None = None)

Bases: MatchboxHttpException

The resolution is not ready to be queried.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 422

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxCollectionAlreadyExists

MatchboxCollectionAlreadyExists(message: str | None = None)

Bases: MatchboxHttpException

Collection already exists.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 409

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxRunAlreadyExists

MatchboxRunAlreadyExists(message: str | None = None)

Bases: MatchboxHttpException

Run already exists.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 409

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxRunNotWriteable

MatchboxRunNotWriteable(message: str | None = None)

Bases: MatchboxHttpException

Run is not mutable.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 423

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxTooManySamplesRequested

MatchboxTooManySamplesRequested(message: str | None = None)

Bases: MatchboxHttpException

Too many samples have been requested from the server.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 422

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxGroupNotFoundError

MatchboxGroupNotFoundError(message: str | None = None)

Bases: MatchboxHttpException

Raised when a group is not found.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 404

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxGroupAlreadyExistsError

MatchboxGroupAlreadyExistsError(message: str | None = None)

Bases: MatchboxHttpException

Raised when attempting to create a group that already exists.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 409

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxSystemGroupError

MatchboxSystemGroupError(message: str | None = None)

Bases: MatchboxHttpException

Raised when attempting to modify or delete a system group.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 422

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxNoJudgements

MatchboxNoJudgements(message: str | None = None)

Bases: MatchboxHttpException

No judgements found in the database when required for operation.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 404

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxDatabaseWriteError

MatchboxDatabaseWriteError(message: str | None = None)

Bases: MatchboxException

Could not be written to the backend DB, likely due to a constraint violation.

Methods:

  • to_details

    Return exception-specific details for serialisation.

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.

MatchboxLockError

MatchboxLockError(message: str | None = None)

Bases: MatchboxHttpException

Trying to modify locked data.

Methods:

  • to_details

    Return exception-specific details for serialisation.

Attributes:

http_status class-attribute instance-attribute

http_status = 423

to_details

to_details() -> dict[str, Any] | None

Return exception-specific details for serialisation.

Override in subclasses that have additional constructor arguments.