4
4
# license that can be found in the LICENSE file or at
5
5
# https://developers.google.com/open-source/licenses/bsd
6
6
7
- """Spanner DB API exceptions."""
7
+ """Spanner DB API exceptions listed in PEP-249 ."""
8
8
9
9
10
10
class Warning (Exception ):
@@ -23,8 +23,7 @@ class Error(Exception):
23
23
24
24
25
25
class InterfaceError (Error ):
26
- """
27
- Error related to the database interface
26
+ """Error related to the database interface
28
27
rather than the database itself.
29
28
"""
30
29
@@ -38,56 +37,48 @@ class DatabaseError(Error):
38
37
39
38
40
39
class DataError (DatabaseError ):
41
- """
42
- Error due to problems with the processed data like
40
+ """Error due to problems with the processed data like
43
41
division by zero, numeric value out of range, etc.
44
42
"""
45
43
46
44
pass
47
45
48
46
49
47
class OperationalError (DatabaseError ):
50
- """
51
- Error related to the database's operation, e.g. an
52
- unexpected disconnect, the data source name is not
53
- found, a transaction could not be processed, a
54
- memory allocation error, etc.
48
+ """Error related to the database's operation, e.g. an unexpected
49
+ disconnect, the data source name is not found, a transaction could not
50
+ be processed, a memory allocation error, etc.
55
51
"""
56
52
57
53
pass
58
54
59
55
60
56
class IntegrityError (DatabaseError ):
61
- """
62
- Error for cases of relational integrity of the database
57
+ """Error for cases of relational integrity of the database
63
58
is affected, e.g. a foreign key check fails.
64
59
"""
65
60
66
61
pass
67
62
68
63
69
64
class InternalError (DatabaseError ):
70
- """
71
- Internal database error, e.g. the cursor is not valid
65
+ """Internal database error, e.g. the cursor is not valid
72
66
anymore, the transaction is out of sync, etc.
73
67
"""
74
68
75
69
pass
76
70
77
71
78
72
class ProgrammingError (DatabaseError ):
79
- """
80
- Programming error, e.g. table not found or already
81
- exists, syntax error in the SQL statement, wrong
82
- number of parameters specified, etc.
73
+ """Programming error, e.g. table not found or already exists, syntax
74
+ error in the SQL statement, wrong number of parameters specified, etc.
83
75
"""
84
76
85
77
pass
86
78
87
79
88
80
class NotSupportedError (DatabaseError ):
89
- """
90
- Error for case of a method or database API not
81
+ """Error for case of a method or database API not
91
82
supported by the database was used.
92
83
"""
93
84
0 commit comments