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: EntityError

A retrieval of the entity was not possible because there is more than one possible candidate.

exception linkahead.exceptions.AuthorizationError(error=None, entity=None)

Bases: EntityError

You 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: LinkAheadException

Base class for query errors that are not transaction errors.

exception linkahead.exceptions.CaosDBConnectionError(msg=None)

Bases: LinkAheadException

exception linkahead.exceptions.CaosDBException(msg)

Bases: Exception

exception linkahead.exceptions.ConfigurationError(msg)

Bases: LinkAheadException

ConfigurationError.

Indicates a misconfiguration.

Parameters:

msg (str) – A descriptin of the misconfiguration. The constructor adds a few lines with explainingg where to find the configuration.

msg

A description of the misconfiguration.

Type:

str

exception linkahead.exceptions.ConsistencyError(error=None, entity=None)

Bases: EntityError

The transaction violates database consistency.

exception linkahead.exceptions.EmptyUniqueQueryError(msg)

Bases: BadQueryError

A unique query or retrieve dound no result.

exception linkahead.exceptions.EntityDoesNotExistError(error=None, entity=None)

Bases: EntityError

This entity does not exist.

exception linkahead.exceptions.EntityError(error=None, entity=None)

Bases: TransactionError

This 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: EntityError

This entity has no ACL (yet).

exception linkahead.exceptions.EntityHasNoDatatypeError(error=None, entity=None)

Bases: EntityError

This has to have a data type.

exception linkahead.exceptions.HTTPClientError(msg, status, body)

Bases: LinkAheadException

HTTPClientError represents 4xx HTTP client errors.

exception linkahead.exceptions.HTTPForbiddenError(msg=None)

Bases: HTTPClientError

You’re lacking the required permissions. Corresponds to HTTP status 403.

exception linkahead.exceptions.HTTPResourceNotFoundError(msg=None)

Bases: HTTPClientError

The requested resource doesn’t exist; corresponds to HTTP status 404.

exception linkahead.exceptions.HTTPServerError(body)

Bases: LinkAheadException

HTTPServerError represents 5xx HTTP server errors.

exception linkahead.exceptions.HTTPURITooLongError(msg=None)

Bases: HTTPClientError

The URI of the last request was too long.

exception linkahead.exceptions.LinkAheadConnectionError(msg=None)

Bases: CaosDBConnectionError

Connection is not configured or the network is down.

exception linkahead.exceptions.LinkAheadException(msg)

Bases: CaosDBException

Base class of all LinkAhead exceptions.

exception linkahead.exceptions.LoginFailedError(msg=None)

Bases: LinkAheadException

Login failed.

Probably, your username/password pair is wrong.

exception linkahead.exceptions.MismatchingEntitiesError(msg)

Bases: LinkAheadException

Mismatching entities were found during container sync.

exception linkahead.exceptions.PagingConsistencyError(msg)

Bases: BadQueryError

The database state changed between two consecutive paged requests of the same query.

exception linkahead.exceptions.QueryNotUniqueError(msg)

Bases: BadQueryError

A unique query or retrieve found more than one entity.

exception linkahead.exceptions.ServerConfigurationException(msg)

Bases: LinkAheadException

The 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: LinkAheadException

An 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:

bool

exception linkahead.exceptions.UniqueNamesError(error=None, entity=None)

Bases: EntityError

A name was supposed to be unique but was not.

exception linkahead.exceptions.UnqualifiedParentsError(error=None, entity=None)

Bases: EntityError

This 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: EntityError

This 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).