Exceptions

exception lbox.exceptions.ApiLimitError(message, cause=None)[source]

Bases: LabelboxError

Raised when the user performs too many requests in a short period of time.

exception lbox.exceptions.AuthenticationError(message, cause=None)[source]

Bases: LabelboxError

Raised when an API key fails authentication.

exception lbox.exceptions.AuthorizationError(message, cause=None)[source]

Bases: LabelboxError

Raised when a user is unauthorized to perform the given request.

exception lbox.exceptions.ConfidenceNotSupportedException[source]

Bases: Exception

Raised when confidence is specified for unsupported annotation type

exception lbox.exceptions.CustomMetricsNotSupportedException[source]

Bases: Exception

Raised when custom_metrics is specified for unsupported annotation type

exception lbox.exceptions.InconsistentOntologyException[source]

Bases: Exception

exception lbox.exceptions.InternalServerError(message, cause=None)[source]

Bases: LabelboxError

Nondescript prisma or 502 related errors.

Meant to be retryable.

TODO: these errors need better messages from platform

exception lbox.exceptions.InvalidAttributeError(db_object_type, field)[source]

Bases: LabelboxError

Raised when a field (name or Field instance) is not valid or found for a specific DB object type.

exception lbox.exceptions.InvalidQueryError(message, cause=None)[source]

Bases: LabelboxError

Indicates a malconstructed or unsupported query (either by GraphQL in general or by Labelbox specifically). This can be the result of either client or server side query validation.

exception lbox.exceptions.LabelboxError(message, cause=None)[source]

Bases: Exception

Base class for exceptions.

exception lbox.exceptions.MALValidationError(message, cause=None)[source]

Bases: LabelboxError

Raised when user input is invalid for MAL imports.

exception lbox.exceptions.MalformedQueryException[source]

Bases: Exception

Raised when the user submits a malformed query.

exception lbox.exceptions.NetworkError(cause)[source]

Bases: LabelboxError

Raised when an HTTPError occurs.

exception lbox.exceptions.OperationNotAllowedException[source]

Bases: Exception

Raised when user does not have permissions to a resource or has exceeded usage limit

exception lbox.exceptions.OperationNotSupportedException[source]

Bases: Exception

Raised when sdk does not support requested operation

exception lbox.exceptions.ProcessingWaitTimeout[source]

Bases: Exception

Raised when waiting for the data rows to be processed takes longer than allowed

exception lbox.exceptions.ResourceConflict(message, cause=None)[source]

Bases: LabelboxError

Exception raised when a given resource conflicts with another.

exception lbox.exceptions.ResourceCreationError(message, cause=None)[source]

Bases: LabelboxError

Indicates that a resource could not be created in the server side due to a validation or transaction error

exception lbox.exceptions.ResourceNotFoundError(db_object_type=None, params=None, message=None)[source]

Bases: LabelboxError

Exception raised when a given resource is not found.

exception lbox.exceptions.TimeoutError(message, cause=None)[source]

Bases: LabelboxError

Raised when a request times-out.

exception lbox.exceptions.UnprocessableEntityError(message, cause=None)[source]

Bases: LabelboxError

Indicates that a resource could not be created in the server side due to a validation or transaction error

exception lbox.exceptions.UuidError(message, cause=None)[source]

Bases: LabelboxError

Raised when there are repeat Uuid’s in bulk import request.

exception lbox.exceptions.ValidationFailedError(message, cause=None)[source]

Bases: LabelboxError

Exception raised for when a GraphQL query fails validation (query cost, etc.) E.g. a query that is too expensive, or depth is too deep.

lbox.exceptions.error_message_for_unparsed_graphql_error(error_string: str) str[source]

Since our client only parses certain graphql errors, this function is used to extract the error message from the error string when the error is not parsed by the client.