To be used in the connection pool to detect timeout on connection.
Backported to Psycopg 3.0.8 to allow the pool 3.1 to work with it, at
least on diminished capacity (NullPool.connection() would time out only
for clients in the queue, not in case of new connection timeout).
__module__ = "psycopg"
+class ConnectionTimeout(OperationalError):
+ """
+ Exception raised on timeout connection.
+ """
+
+
class Diagnostic:
"""Details from a database error report."""
rlist = sel.select(timeout=timeout)
sel.unregister(fileno)
if not rlist:
- raise e.OperationalError("timeout expired")
+ raise e.ConnectionTimeout("connection timeout expired")
ready: Ready = rlist[0][1] # type: ignore[assignment]
fileno, s = gen.send(ready)
fileno, s = gen.send(ready)
except TimeoutError:
- raise e.OperationalError("timeout expired")
+ raise e.ConnectionTimeout("connection timeout expired")
except StopIteration as ex:
rv: RV = ex.args[0] if ex.args else None