Merge "Sync db.exception from Oslo"
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
"""DB related custom exceptions."""
|
"""DB related custom exceptions."""
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
from keystone.openstack.common.gettextutils import _
|
from keystone.openstack.common.gettextutils import _
|
||||||
|
|
||||||
|
|
||||||
@@ -23,7 +25,7 @@ class DBError(Exception):
|
|||||||
"""Wraps an implementation specific exception."""
|
"""Wraps an implementation specific exception."""
|
||||||
def __init__(self, inner_exception=None):
|
def __init__(self, inner_exception=None):
|
||||||
self.inner_exception = inner_exception
|
self.inner_exception = inner_exception
|
||||||
super(DBError, self).__init__(str(inner_exception))
|
super(DBError, self).__init__(six.text_type(inner_exception))
|
||||||
|
|
||||||
|
|
||||||
class DBDuplicateEntry(DBError):
|
class DBDuplicateEntry(DBError):
|
||||||
@@ -46,7 +48,7 @@ class DBInvalidUnicodeParameter(Exception):
|
|||||||
class DbMigrationError(DBError):
|
class DbMigrationError(DBError):
|
||||||
"""Wraps migration specific exception."""
|
"""Wraps migration specific exception."""
|
||||||
def __init__(self, message=None):
|
def __init__(self, message=None):
|
||||||
super(DbMigrationError, self).__init__(str(message))
|
super(DbMigrationError, self).__init__(message)
|
||||||
|
|
||||||
|
|
||||||
class DBConnectionError(DBError):
|
class DBConnectionError(DBError):
|
||||||
|
|||||||
Reference in New Issue
Block a user