Error Module

This file defines all the custom errors.

exception CAM2CameraDatabaseAPIClient.error.Error[source]

Represent a generic error.

exception CAM2CameraDatabaseAPIClient.error.FormatError(message)[source]

Class representing format error.

Detailed error message of the error can be shown by printing the error object.

This corresponends to 422 RequestFormatError in CAM2 Database API.

message

str – Detailed error message

exception CAM2CameraDatabaseAPIClient.error.ResourceNotFoundError(message)[source]

Corresponends to 404 ResourceNotFoundError in API.

exception CAM2CameraDatabaseAPIClient.error.AuthenticationError(message)[source]

Corresponends to 401 AuthenticationError in API.

exception CAM2CameraDatabaseAPIClient.error.InternalError[source]

Corresponends to 500 InternalError in API.

exception CAM2CameraDatabaseAPIClient.error.ResourceConflictError(message)[source]

Corresponends to 409 ResourceConflictError in API. It is used in POST /cameras/create and PUT /cameras/{:camerID} route signaling ‘legacyCameraIDAlreadyExist’

exception CAM2CameraDatabaseAPIClient.error.AuthorizationError(message)[source]

Corresponends to 403 AuthorizationError in API.

exception CAM2CameraDatabaseAPIClient.error.InvalidClientIdError[source]

Corresponends to 403 AuthorizationError in API.

exception CAM2CameraDatabaseAPIClient.error.InvalidClientSecretError[source]

Class representing invalid clientSecret format error.

A valid client secret should have a length of at least 71 characters.

This corresponends to 422 RequestFormatError in CAM2 Database API.

message

str – Detailed error message

Note

Not throwing this error does not mean the client secret is correct. The actual authentication happens when you call client functions.