]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix reference target to the psycopg module
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 14 Jul 2021 00:09:51 +0000 (02:09 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 14 Jul 2021 00:09:51 +0000 (02:09 +0200)
It was stolen by the errors module.

docs/api/errors.rst
docs/api/module.rst

index 4993357bd8ccfe42847890da1d1c377b1277cb76..6994f733e049b3107a805c3b4136a5fc22be4cb1 100644 (file)
@@ -1,58 +1,13 @@
 `errors` -- Package exceptions
 ==============================
 
+.. module:: psycopg.errors
+
 .. index::
     single: Error; Class
 
-.. module:: psycopg
-
 This module exposes objects to represent and examine database errors.
 
-.. autoexception:: Error()
-
-    .. autoattribute:: diag
-
-
-.. module:: psycopg.errors
-
-.. autoclass:: Diagnostic()
-
-    The object is returned by the `Error.diag` attribute and is passed to the
-    callback functions registered with
-    `~psycopg.Connection.add_notice_handler()`.
-
-    All the information available from the :pq:`PQresultErrorField()` function
-    are exposed as attributes by the object. For instance the `!severity`
-    attribute returns the `!PG_DIAG_SEVERITY` code. Please refer to the
-    PostgreSQL documentation for the meaning of all the attributes.
-
-    The attributes available are:
-
-    .. attribute::
-        column_name
-        constraint_name
-        context
-        datatype_name
-        internal_position
-        internal_query
-        message_detail
-        message_hint
-        message_primary
-        schema_name
-        severity
-        severity_nonlocalized
-        source_file
-        source_function
-        source_line
-        sqlstate
-        statement_position
-        table_name
-
-        A string with the error field if available; `!None` if not available.
-        The attribute value is available only for errors sent by the server:
-        not all the fields are available for all the errors and for all the
-        server versions.
-
 
 .. currentmodule:: psycopg
 
@@ -84,6 +39,10 @@ derive from the following classes:
 These classes are exposed both by the Psycopg and the `!psycopg.errors`
 module.
 
+.. autoexception:: Error()
+
+    .. autoattribute:: diag
+
 .. autoexception:: Warning()
 .. autoexception:: InterfaceError()
 .. autoexception:: DatabaseError()
@@ -102,6 +61,49 @@ module.
 
 .. _sqlstate-exceptions:
 
+
+Error diagnostics
+-----------------
+
+.. autoclass:: Diagnostic()
+
+    The object is returned by the `Error.diag` attribute and is passed to the
+    callback functions registered with
+    `~psycopg.Connection.add_notice_handler()`.
+
+    All the information available from the :pq:`PQresultErrorField()` function
+    are exposed as attributes by the object. For instance the `!severity`
+    attribute returns the `!PG_DIAG_SEVERITY` code. Please refer to the
+    PostgreSQL documentation for the meaning of all the attributes.
+
+    The attributes available are:
+
+    .. attribute::
+        column_name
+        constraint_name
+        context
+        datatype_name
+        internal_position
+        internal_query
+        message_detail
+        message_hint
+        message_primary
+        schema_name
+        severity
+        severity_nonlocalized
+        source_file
+        source_function
+        source_line
+        sqlstate
+        statement_position
+        table_name
+
+        A string with the error field if available; `!None` if not available.
+        The attribute value is available only for errors sent by the server:
+        not all the fields are available for all the errors and for all the
+        server versions.
+
+
 SQLSTATE exceptions
 -------------------
 
index aeb70b3fec84b0cc04e23c42861f8c66816b217c..a9c98e31aa979fe1ac8b4aab2fe72623a8dfa649 100644 (file)
@@ -7,8 +7,7 @@ it also exposes the `module-level objects`__ required by the specifications.
 .. __: https://www.python.org/dev/peps/pep-0249/
 .. __: https://www.python.org/dev/peps/pep-0249/#module-interface
 
-
-.. currentmodule:: psycopg
+.. module:: psycopg
 
 .. autofunction:: connect