]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Add doc section to refer to the exceptions list
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 11 Feb 2022 19:32:55 +0000 (20:32 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 11 Feb 2022 20:02:30 +0000 (21:02 +0100)
Also clarify Error.sqlstate and further errors doc cleanup.

docs/api/errors.rst

index 4c44a4110a4fb5ee29a538aa23677d1b3449d230..0b612803e3060021f5cd3e8b849d80d05ff4884b 100644 (file)
@@ -43,10 +43,10 @@ These classes are exposed both by this module and the root `psycopg` module.
     .. autoattribute:: diag
     .. autoattribute:: sqlstate
 
-        The code of the error, if defined.
+        The code of the error, if received from the server.
 
-        This is a class attribute defined for all the
-        :ref:`sqlstate-exceptions` classes, `!None` for the base classes.
+        This attribute is also available as class attribute on the
+        :ref:`sqlstate-exceptions` classes.
 
 .. autoexception:: Warning()
 .. autoexception:: InterfaceError()
@@ -134,12 +134,13 @@ Every class in the module is named after what referred as "condition name" `in
 the documentation`__, converted to CamelCase: e.g. the error 22012,
 ``division_by_zero`` is exposed by this module as the class `!DivisionByZero`.
 There is a handful of... exceptions to this rule, required for disambiguate
-name clashes: please refer to the table below for all the classes defined.
+name clashes: please refer to the :ref:`table below <exceptions-list>` for all
+the classes defined.
 
 .. __: https://www.postgresql.org/docs/current/errcodes-appendix.html#ERRCODES-TABLE
 
 Every exception class is a subclass of one of the :ref:`standard DB-API
-exception <dbapi-exceptions>` and expose the `Error` interface.
+exception <dbapi-exceptions>`, thus exposing the `~psycopg.Error` interface.
 
 
 .. autofunction:: lookup
@@ -157,7 +158,13 @@ exception <dbapi-exceptions>` and expose the `Error` interface.
             locked = True
 
 
-These are all the classes defined and the DBAPI exception they derive from:
+.. _exceptions-list:
+
+List of known exceptions
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following are all the SQLSTATE-related error classed defined by this
+module, together with the base DBAPI exception they derive from.
 
 .. autogenerated: start