Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/MySQLdb/_exceptions.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Exception classes for _mysql and MySQLdb.
3These classes are dictated by the DB API v2.0:
5 https://www.python.org/dev/peps/pep-0249/
6"""
9class MySQLError(Exception):
10 """Exception related to operation with MySQL."""
13class Warning(Warning, MySQLError):
14 """Exception raised for important warnings like data truncations
15 while inserting, etc."""
18class Error(MySQLError):
19 """Exception that is the base class of all other error exceptions
20 (not Warning)."""
23class InterfaceError(Error):
24 """Exception raised for errors that are related to the database
25 interface rather than the database itself."""
28class DatabaseError(Error):
29 """Exception raised for errors that are related to the
30 database."""
33class DataError(DatabaseError):
34 """Exception raised for errors that are due to problems with the
35 processed data like division by zero, numeric value out of range,
36 etc."""
39class OperationalError(DatabaseError):
40 """Exception raised for errors that are related to the database's
41 operation and not necessarily under the control of the programmer,
42 e.g. an unexpected disconnect occurs, the data source name is not
43 found, a transaction could not be processed, a memory allocation
44 error occurred during processing, etc."""
47class IntegrityError(DatabaseError):
48 """Exception raised when the relational integrity of the database
49 is affected, e.g. a foreign key check fails, duplicate key,
50 etc."""
53class InternalError(DatabaseError):
54 """Exception raised when the database encounters an internal
55 error, e.g. the cursor is not valid anymore, the transaction is
56 out of sync, etc."""
59class ProgrammingError(DatabaseError):
60 """Exception raised for programming errors, e.g. table not found
61 or already exists, syntax error in the SQL statement, wrong number
62 of parameters specified, etc."""
65class NotSupportedError(DatabaseError):
66 """Exception raised in case a method or database API was used
67 which is not supported by the database, e.g. requesting a
68 .rollback() on a connection that does not support transaction or
69 has transactions turned off."""