diff -r f0e86b60de5f Doc/library/sqlite3.rst --- a/Doc/library/sqlite3.rst Wed Aug 10 12:50:16 2016 -0400 +++ b/Doc/library/sqlite3.rst Wed Aug 10 19:12:53 2016 +0200 @@ -113,6 +113,40 @@ :pep:`249` - Database API Specification 2.0 PEP written by Marc-André Lemburg. +.. _sqlite3-exceptions: + +Exceptions +---------- + + +.. exception:: Warning + + Exception raised for important warnings like data truncations + while inserting, etc. It is a subclass of :exc:`Exception`. + +.. exception:: Error + + Exception that is the base class of all other error + exceptions. You can use this to catch all errors with one single + ``except`` statement. Warnings are not considered errors and thus + should not use this class as base. It is a subclass of :exc:`Exception`. + +.. exception:: DatabaseError + + Exception raised for errors that are related to the database. It + is a subclass of :exc:`Error` + +.. exception:: IntegrityError + + Exception raised when the relational integrity of the database is + affected, e.g. a foreign key check fails. It is a subclass + of :exc:`DatabaseError`. + +.. exception:: ProgrammingError + + Exception raised for programming errors, e.g. table not found or + already exists, syntax error in the SQL statement, wrong number of + parameters specified, etc. It is a subclass of :exc:`DatabaseError`. .. _sqlite3-module-contents: @@ -542,7 +576,7 @@ .. literalinclude:: ../includes/sqlite3/execute_1.py :meth:`execute` will only execute a single SQL statement. If you try to execute - more than one statement with it, it will raise an ``sqlite3.Warning``. Use + more than one statement with it, it will raise an :exc:`sqlite3.Warning`. Use :meth:`executescript` if you want to execute multiple SQL statements with one call. @@ -605,7 +639,7 @@ Close the cursor now (rather than whenever ``__del__`` is called). - The cursor will be unusable from this point forward; a ``ProgrammingError`` + The cursor will be unusable from this point forward; a :exc:`sqlite3.ProgrammingError` exception will be raised if any operation is attempted with the cursor. .. attribute:: rowcount