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