The oslo_db.sqlalchemy.exc_filters
Module¶
Define exception redefinitions for SQLAlchemy DBAPI exceptions.
-
oslo_db.sqlalchemy.exc_filters.
filters
(dbname, exception_type, regex)¶ Mark a function as receiving a filtered exception.
Parameters: - dbname – string database name, e.g. ‘mysql’
- exception_type – a SQLAlchemy database exception class, which
extends from
sqlalchemy.exc.DBAPIError
. - regex – a string, or a tuple of strings, that will be processed as matching regular expressions.
-
oslo_db.sqlalchemy.exc_filters.
handle_connect_error
(engine)¶ Connect to the engine, including handle_error handlers.
The compat library now builds this into the engine.connect() system as per SQLAlchemy 1.0’s behavior.
-
oslo_db.sqlalchemy.exc_filters.
handler
(context)¶ Iterate through available filters and invoke those which match.
The first one which raises wins. The order in which the filters are attempted is sorted by specificity - dialect name or “*”, exception class per method resolution order (
__mro__
). Method resolution order is used so that filter rules indicating a more specific exception class are attempted first.
-
oslo_db.sqlalchemy.exc_filters.
register_engine
(engine)¶