]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: add ConnectionTimeout documentation
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 2 Apr 2022 22:58:05 +0000 (00:58 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 2 Apr 2022 23:14:17 +0000 (01:14 +0200)
docs/api/errors.rst
psycopg/psycopg/errors.py

index 3f0a719bb3f5505c7ca720f99e1b8f1e3608ff07..ca567be263418ed55da365e1d555a6c22c8364e6 100644 (file)
@@ -73,12 +73,22 @@ These classes are exposed both by this module and the root `psycopg` module.
 .. autoexception:: NotSupportedError()
 
 
+Other Psycopg errors
+^^^^^^^^^^^^^^^^^^^^
+
 .. currentmodule:: psycopg.errors
 
+
+In addition to the standard DB-API errors, Psycopg defines a few more specific
+ones.
+
+.. autoexception:: ConnectionTimeout()
+
+
+
 .. index::
     single: Exceptions; PostgreSQL
 
-
 Error diagnostics
 -----------------
 
index 28c678677cb5186f6b7d9088fe3046704ba2aa83..526e78c1d66f0d59117c72f83de209302a8aaac7 100644 (file)
@@ -182,7 +182,7 @@ class ProgrammingError(DatabaseError):
 
 class NotSupportedError(DatabaseError):
     """
-    A method or database API was used which is not supported by the database,
+    A method or database API was used which is not supported by the database.
     """
 
     __module__ = "psycopg"
@@ -190,7 +190,12 @@ class NotSupportedError(DatabaseError):
 
 class ConnectionTimeout(OperationalError):
     """
-    Exception raised on timeout connection.
+    Exception raised on timeout of the `~psycopg.Connection.connect()` method.
+
+    The error is raised if the ``connect_timeout`` is specified and a
+    connection is not obtained in useful time.
+
+    Subclass of `~psycopg.OperationalError`.
     """