From: Daniele Varrazzo Date: Sat, 2 Apr 2022 22:58:05 +0000 (+0200) Subject: docs: add ConnectionTimeout documentation X-Git-Tag: 3.1~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68c377d90d945cd2647b9e2a69682df8146b0bc2;p=thirdparty%2Fpsycopg.git docs: add ConnectionTimeout documentation --- diff --git a/docs/api/errors.rst b/docs/api/errors.rst index 3f0a719bb..ca567be26 100644 --- a/docs/api/errors.rst +++ b/docs/api/errors.rst @@ -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 ----------------- diff --git a/psycopg/psycopg/errors.py b/psycopg/psycopg/errors.py index 28c678677..526e78c1d 100644 --- a/psycopg/psycopg/errors.py +++ b/psycopg/psycopg/errors.py @@ -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`. """