diff options
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py index 3caab9465..43d16642f 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -88,6 +88,8 @@ def wrap_db_error(f): def _wrap(*args, **kwargs): try: return f(*args, **kwargs) + except UnicodeEncodeError: + raise InvalidUnicodeParameter() except Exception, e: LOG.exception(_('DB exception wrapped.')) raise DBError(e) @@ -275,6 +277,11 @@ class InvalidRPCConnectionReuse(Invalid): message = _("Invalid reuse of an RPC connection.") +class InvalidUnicodeParameter(Invalid): + message = _("Invalid Parameter: " + "Unicode is not supported by the current database.") + + # Cannot be templated as the error syntax varies. # msg needs to be constructed when raised. class InvalidParameterValue(Invalid): |