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