Skip to content

errors.py

Exception classes for the DataJoint library

DataJointError

Bases: Exception

Base class for errors specific to DataJoint internal operation.

Source code in datajoint/errors.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class DataJointError(Exception):
    """
    Base class for errors specific to DataJoint internal operation.
    """

    def __init__(self, *args):
        from .plugin import connection_plugins, type_plugins

        self.__cause__ = (
            PluginWarning("Unverified DataJoint plugin detected.")
            if any(
                [
                    any([not plugins[k]["verified"] for k in plugins])
                    for plugins in [connection_plugins, type_plugins]
                    if plugins
                ]
            )
            else None
        )

    def suggest(self, *args):
        """
        regenerate the exception with additional arguments

        :param args: addition arguments
        :return: a new exception of the same type with the additional arguments
        """
        return self.__class__(*(self.args + args))

suggest(*args)

regenerate the exception with additional arguments

Parameters:

Name Type Description Default
args

addition arguments

()

Returns:

Type Description

a new exception of the same type with the additional arguments

Source code in datajoint/errors.py
34
35
36
37
38
39
40
41
def suggest(self, *args):
    """
    regenerate the exception with additional arguments

    :param args: addition arguments
    :return: a new exception of the same type with the additional arguments
    """
    return self.__class__(*(self.args + args))

LostConnectionError

Bases: DataJointError

Loss of server connection

Source code in datajoint/errors.py
45
46
47
48
class LostConnectionError(DataJointError):
    """
    Loss of server connection
    """

QueryError

Bases: DataJointError

Errors arising from queries to the database

Source code in datajoint/errors.py
51
52
53
54
class QueryError(DataJointError):
    """
    Errors arising from queries to the database
    """

QuerySyntaxError

Bases: QueryError

Errors arising from incorrect query syntax

Source code in datajoint/errors.py
58
59
60
61
class QuerySyntaxError(QueryError):
    """
    Errors arising from incorrect query syntax
    """

AccessError

Bases: QueryError

User access error: insufficient privileges.

Source code in datajoint/errors.py
64
65
66
67
class AccessError(QueryError):
    """
    User access error: insufficient privileges.
    """

MissingTableError

Bases: DataJointError

Query on a table that has not been declared

Source code in datajoint/errors.py
70
71
72
73
class MissingTableError(DataJointError):
    """
    Query on a table that has not been declared
    """

DuplicateError

Bases: QueryError

An integrity error caused by a duplicate entry into a unique key

Source code in datajoint/errors.py
76
77
78
79
class DuplicateError(QueryError):
    """
    An integrity error caused by a duplicate entry into a unique key
    """

IntegrityError

Bases: QueryError

An integrity error triggered by foreign key constraints

Source code in datajoint/errors.py
82
83
84
85
class IntegrityError(QueryError):
    """
    An integrity error triggered by foreign key constraints
    """

UnknownAttributeError

Bases: QueryError

User requests an attribute name not found in query heading

Source code in datajoint/errors.py
88
89
90
91
class UnknownAttributeError(QueryError):
    """
    User requests an attribute name not found in query heading
    """

MissingAttributeError

Bases: QueryError

An error arising when a required attribute value is not provided in INSERT

Source code in datajoint/errors.py
94
95
96
97
class MissingAttributeError(QueryError):
    """
    An error arising when a required attribute value is not provided in INSERT
    """

MissingExternalFile

Bases: DataJointError

Error raised when an external file managed by DataJoint is no longer accessible

Source code in datajoint/errors.py
100
101
102
103
class MissingExternalFile(DataJointError):
    """
    Error raised when an external file managed by DataJoint is no longer accessible
    """

BucketInaccessible

Bases: DataJointError

Error raised when a S3 bucket is inaccessible

Source code in datajoint/errors.py
106
107
108
109
class BucketInaccessible(DataJointError):
    """
    Error raised when a S3 bucket is inaccessible
    """