9
9
class MySQLError (Exception ):
10
10
"""Exception related to operation with MySQL."""
11
11
12
+ __module__ = "MySQLdb"
13
+
12
14
13
15
class Warning (Warning , MySQLError ):
14
16
"""Exception raised for important warnings like data truncations
15
17
while inserting, etc."""
16
18
19
+ __module__ = "MySQLdb"
20
+
17
21
18
22
class Error (MySQLError ):
19
23
"""Exception that is the base class of all other error exceptions
20
24
(not Warning)."""
21
25
26
+ __module__ = "MySQLdb"
27
+
22
28
23
29
class InterfaceError (Error ):
24
30
"""Exception raised for errors that are related to the database
25
31
interface rather than the database itself."""
26
32
33
+ __module__ = "MySQLdb"
34
+
27
35
28
36
class DatabaseError (Error ):
29
37
"""Exception raised for errors that are related to the
30
38
database."""
31
39
40
+ __module__ = "MySQLdb"
41
+
32
42
33
43
class DataError (DatabaseError ):
34
44
"""Exception raised for errors that are due to problems with the
35
45
processed data like division by zero, numeric value out of range,
36
46
etc."""
37
47
48
+ __module__ = "MySQLdb"
49
+
38
50
39
51
class OperationalError (DatabaseError ):
40
52
"""Exception raised for errors that are related to the database's
@@ -43,27 +55,37 @@ class OperationalError(DatabaseError):
43
55
found, a transaction could not be processed, a memory allocation
44
56
error occurred during processing, etc."""
45
57
58
+ __module__ = "MySQLdb"
59
+
46
60
47
61
class IntegrityError (DatabaseError ):
48
62
"""Exception raised when the relational integrity of the database
49
63
is affected, e.g. a foreign key check fails, duplicate key,
50
64
etc."""
51
65
66
+ __module__ = "MySQLdb"
67
+
52
68
53
69
class InternalError (DatabaseError ):
54
70
"""Exception raised when the database encounters an internal
55
71
error, e.g. the cursor is not valid anymore, the transaction is
56
72
out of sync, etc."""
57
73
74
+ __module__ = "MySQLdb"
75
+
58
76
59
77
class ProgrammingError (DatabaseError ):
60
78
"""Exception raised for programming errors, e.g. table not found
61
79
or already exists, syntax error in the SQL statement, wrong number
62
80
of parameters specified, etc."""
63
81
82
+ __module__ = "MySQLdb"
83
+
64
84
65
85
class NotSupportedError (DatabaseError ):
66
86
"""Exception raised in case a method or database API was used
67
87
which is not supported by the database, e.g. requesting a
68
88
.rollback() on a connection that does not support transaction or
69
89
has transactions turned off."""
90
+
91
+ __module__ = "MySQLdb"
0 commit comments