linkahead.exceptions module
The exceptions module defines exceptions for HTTP Errors (4xx and 5xx and HTTP response codes) and for transaction errors (i.e. missing permissions, dependencies, non-passing consistency checks etc.).
- exception linkahead.exceptions.AmbiguousEntityError(error=None, entity=None)
Bases:
EntityErrorA retrieval of the entity was not possible because there is more than one possible candidate.
- exception linkahead.exceptions.AuthorizationError(error=None, entity=None)
Bases:
EntityErrorYou are not allowed to do what ever you tried to do.
Maybe you need more privileges or a user account.
- exception linkahead.exceptions.BadQueryError(msg)
Bases:
LinkAheadExceptionBase class for query errors that are not transaction errors.
- exception linkahead.exceptions.CaosDBConnectionError(msg=None)
Bases:
LinkAheadException
- exception linkahead.exceptions.ConfigurationError(msg)
Bases:
LinkAheadExceptionConfigurationError.
Indicates a misconfiguration.
- Parameters:
msg (str) – A descriptin of the misconfiguration. The constructor adds a few lines with explainingg where to find the configuration.
- exception linkahead.exceptions.ConsistencyError(error=None, entity=None)
Bases:
EntityErrorThe transaction violates database consistency.
- exception linkahead.exceptions.EmptyUniqueQueryError(msg)
Bases:
BadQueryErrorA unique query or retrieve found no result.
- exception linkahead.exceptions.EntityDoesNotExistError(error=None, entity=None)
Bases:
EntityErrorThis entity does not exist.
- exception linkahead.exceptions.EntityError(error=None, entity=None)
Bases:
TransactionErrorThis is the most basic entity error. It is constructed using an entity that caused the error and the error message attached by the server.
- property description
The description of the error.
- exception linkahead.exceptions.EntityHasNoAclError(error=None, entity=None)
Bases:
EntityErrorThis entity has no ACL (yet).
- exception linkahead.exceptions.EntityHasNoDatatypeError(error=None, entity=None)
Bases:
EntityErrorThis has to have a data type.
- exception linkahead.exceptions.HTTPClientError(msg, status, body)
Bases:
LinkAheadExceptionHTTPClientError represents 4xx HTTP client errors.
- exception linkahead.exceptions.HTTPForbiddenError(msg=None)
Bases:
HTTPClientErrorYou’re lacking the required permissions. Corresponds to HTTP status 403.
- exception linkahead.exceptions.HTTPResourceNotFoundError(msg=None)
Bases:
HTTPClientErrorThe requested resource doesn’t exist; corresponds to HTTP status 404.
- exception linkahead.exceptions.HTTPServerError(body)
Bases:
LinkAheadExceptionHTTPServerError represents 5xx HTTP server errors.
- exception linkahead.exceptions.HTTPURITooLongError(msg=None)
Bases:
HTTPClientErrorThe URI of the last request was too long.
- exception linkahead.exceptions.LinkAheadConnectionError(msg=None)
Bases:
CaosDBConnectionErrorConnection is not configured or the network is down.
- exception linkahead.exceptions.LinkAheadException(msg)
Bases:
CaosDBExceptionBase class of all LinkAhead exceptions.
- exception linkahead.exceptions.LoginFailedError(msg=None)
Bases:
LinkAheadExceptionLogin failed.
Probably, your username/password pair is wrong.
- exception linkahead.exceptions.MismatchingEntitiesError(msg)
Bases:
LinkAheadExceptionMismatching entities were found during container sync.
- exception linkahead.exceptions.PagingConsistencyError(msg)
Bases:
BadQueryErrorThe database state changed between two consecutive paged requests of the same query.
- exception linkahead.exceptions.QueryNotUniqueError(msg)
Bases:
BadQueryErrorA unique query or retrieve found more than one entity.
- exception linkahead.exceptions.ServerConfigurationException(msg)
Bases:
LinkAheadExceptionThe server is configured in a different way than expected.
This can be for example unexpected flags or settings or missing extensions.
- exception linkahead.exceptions.TransactionError(error=None, msg='An error occured during the transaction.', container=None)
Bases:
LinkAheadExceptionAn error of this type is raised whenever any transaction fails with one or more entities between client and LinkAhead server. More detailed errors are collected as direct and indirect children in the ‘errors’ list (direct children) and the ‘all_errors’ set (set of all direct and indirect children).
- add_error(error)
Add an error as a direct child to this TransactionError.
@param error: An EntityError or a list of EntityErrors.
@raise TypeError: If and only if the ‘error’ parameter is not an instance of EntityError.
@return: self.
- has_error(error_t, direct_children_only=False)
Check whether this transaction error contains an error of type error_t. If direct_children_only is True, only direct children are checked.
- Parameters:
error_t (EntityError) – error type to be checked
direct_children_only (bool, optional) – If True, only direct children, i.e., all errors in self.errors are checked. Else all direct and indirect children, i.e., all errors in self.all_errors are used. Default is false.
- Returns:
has_error – True if at least one of the children is of type error_t, False otherwise.
- Return type:
- exception linkahead.exceptions.UniqueNamesError(error=None, entity=None)
Bases:
EntityErrorA name was supposed to be unique but was not.
- exception linkahead.exceptions.UnqualifiedParentsError(error=None, entity=None)
Bases:
EntityErrorThis entity has unqualified parents (see ‘errors’ attribute for a list of errors of the parent entities or ‘entities’ attribute for a list of parent entities with errors).
- exception linkahead.exceptions.UnqualifiedPropertiesError(error=None, entity=None)
Bases:
EntityErrorThis entity has unqualified properties (see ‘errors’ attribute for a list of errors of the properties or ‘entities’ attribute for a list of properties with errors).