diff options
author | Julien Danjou <julien@danjou.info> | 2016-06-21 15:51:57 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2016-06-22 10:01:36 +0200 |
commit | c4f025d2c3829a26dfa674823b1b06e99b9366d3 (patch) | |
tree | 580e77b87b3022fa31235971b29af893184f2535 /oslo_db/exception.py | |
parent | a2da070d288fb8e4deb377420dfa2bce85c4b3af (diff) | |
download | oslo-db-c4f025d2c3829a26dfa674823b1b06e99b9366d3.tar.gz |
exc_filters: catch and translate non existent constraint on drop
This patches add a new exception type that is raised when an operation on a non
existing constraint is executed.
Change-Id: Ib55a83b568bdb1c9139af27bd2fbf204508e15e4
Diffstat (limited to 'oslo_db/exception.py')
-rw-r--r-- | oslo_db/exception.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/oslo_db/exception.py b/oslo_db/exception.py index c5e0fa9..e67ea01 100644 --- a/oslo_db/exception.py +++ b/oslo_db/exception.py @@ -127,6 +127,21 @@ class DBReferenceError(DBError): super(DBReferenceError, self).__init__(inner_exception) +class DBNonExistentConstraint(DBError): + """Constraint does not exist. + + :param table: table name + :type table: str + :param constraint: constraint name + :type table: str + """ + + def __init__(self, table, constraint, inner_exception=None): + self.table = table + self.constraint = constraint + super(DBNonExistentConstraint, self).__init__(inner_exception) + + class DBDeadlock(DBError): """Database dead lock error. |