summaryrefslogtreecommitdiff
path: root/oslo_db/exception.py
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2016-02-04 15:11:45 +0100
committerJulien Danjou <julien@danjou.info>2016-06-27 17:29:55 +0200
commite0db469371ca0bea102ec9689d923608df77807a (patch)
treecab7fbe1632f5744c0fdfc46e267eb4cfbf6caef /oslo_db/exception.py
parent1579c7ce1526a952d74faeaad3e0ad1719604221 (diff)
downloadoslo-db-e0db469371ca0bea102ec9689d923608df77807a.tar.gz
exception: make message mandatory in DbMigrationError and deprecates it
An exception message with None as an error message is not really useful. Since DbMigrationError is also wrongly written with a lower case b whereas everything else has a major B, let's create a new correct class and use it. debtcollector is used to deprecate the old one, and inheritance makes sure the current code works. Change-Id: Id9a477aff38afd5b664b75a549ad561f4c24b6f0
Diffstat (limited to 'oslo_db/exception.py')
-rw-r--r--oslo_db/exception.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/oslo_db/exception.py b/oslo_db/exception.py
index c5e0fa9..ba7dde0 100644
--- a/oslo_db/exception.py
+++ b/oslo_db/exception.py
@@ -171,6 +171,20 @@ class DbMigrationError(DBError):
super(DbMigrationError, self).__init__(message)
+class DBMigrationError(DbMigrationError):
+
+ """Wrapped migration specific exception.
+
+ Raised when migrations couldn't be completed successfully.
+ """
+ def __init__(self, message):
+ super(DBMigrationError, self).__init__(message)
+
+
+debtcollector.removals.removed_class(DbMigrationError,
+ replacement=DBMigrationError)
+
+
class DBConnectionError(DBError):
"""Wrapped connection specific exception.