Repository navigation
Expand file tree
/
Copy patherrors.py
More file actions
78 lines (47 loc) · 1.92 KB
/
Copy patherrors.py
File metadata and controls
78 lines (47 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""
Exception classes for the DataJoint library.
This module defines the exception hierarchy for DataJoint errors.
"""
from __future__ import annotations
# --- Top Level ---
class DataJointError(Exception):
"""Base class for errors specific to DataJoint internal operation."""
def suggest(self, *args: object) -> "DataJointError":
"""
Regenerate the exception with additional arguments.
Parameters
----------
*args : object
Additional arguments to append to the exception.
Returns
-------
DataJointError
A new exception of the same type with the additional arguments.
"""
return self.__class__(*(self.args + args))
# --- Second Level ---
class LostConnectionError(DataJointError):
"""Loss of server connection."""
class QueryError(DataJointError):
"""Errors arising from queries to the database."""
# --- Third Level: QueryErrors ---
class QuerySyntaxError(QueryError):
"""Errors arising from incorrect query syntax."""
class AccessError(QueryError):
"""User access error: insufficient privileges."""
class MissingTableError(DataJointError):
"""Query on a table that has not been declared."""
class DuplicateError(QueryError):
"""Integrity error caused by a duplicate entry into a unique key."""
class IntegrityError(QueryError):
"""Integrity error triggered by foreign key constraints."""
class UnknownAttributeError(QueryError):
"""User requests an attribute name not found in query heading."""
class MissingAttributeError(QueryError):
"""Required attribute value not provided in INSERT."""
class MissingExternalFile(DataJointError):
"""External file managed by DataJoint is no longer accessible."""
class BucketInaccessible(DataJointError):
"""S3 bucket is inaccessible."""
class ThreadSafetyError(DataJointError):
"""Global DataJoint state is disabled in thread-safe mode."""