diff --git a/libraries/entropy/exceptions.py b/libraries/entropy/exceptions.py index c49b6fba0..66c974952 100644 --- a/libraries/entropy/exceptions.py +++ b/libraries/entropy/exceptions.py @@ -11,7 +11,7 @@ This module contains Entropy Framework exceptions classes. """ -from entropy.const import const_isstring +from entropy.const import const_isstring, const_convert_to_unicode class DumbException(Exception): """Dumb exception class""" @@ -22,6 +22,11 @@ class EntropyException(Exception): self.value = value[:] Exception.__init__(self) + def __unicode__(self): + if const_isstring(self.value): + return const_convert_to_unicode(self.value) + return const_convert_to_unicode(repr(self.value)) + def __str__(self): if const_isstring(self.value): return self.value