]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add pgcode / sqlstate for asyncpg error message
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 5 Apr 2021 18:41:31 +0000 (14:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 6 Apr 2021 00:13:01 +0000 (20:13 -0400)
commitd01790ebe0b425bf79c4decf24011d0d6234944d
treef9e4267e46239671f123743c21672141d56c6626
parent165c3a65dcb1ba3f42ecf2b5da7c298bdc259f9b
Add pgcode / sqlstate for asyncpg error message

Added accessors ``.sqlstate`` and synonym ``.pgcode`` to the ``.orig``
attribute of the SQLAlchemy exception class raised by the asyncpg DBAPI
adapter, that is, the intermediary exception object that wraps on top of
that raised by the asyncpg library itself, but below the level of the
SQLAlchemy dialect.

Fixes: #6199
Change-Id: Ie0f1ffaaff47c7a50dd1fbccdbe588cdc5322b70
doc/build/changelog/unreleased_14/6199.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/asyncpg.py
test/dialect/postgresql/test_dialect.py