From: Daniele Varrazzo Date: Fri, 11 Feb 2022 19:32:55 +0000 (+0100) Subject: Add doc section to refer to the exceptions list X-Git-Tag: pool-3.1.1~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1589bf77fe38fd6504414a505ee9c85209bca9dc;p=thirdparty%2Fpsycopg.git Add doc section to refer to the exceptions list Also clarify Error.sqlstate and further errors doc cleanup. --- diff --git a/docs/api/errors.rst b/docs/api/errors.rst index 4c44a4110..0b612803e 100644 --- a/docs/api/errors.rst +++ b/docs/api/errors.rst @@ -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 ` 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 ` and expose the `Error` interface. +exception `, thus exposing the `~psycopg.Error` interface. .. autofunction:: lookup @@ -157,7 +158,13 @@ exception ` 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