diff options
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index 49b628aad..b82d19949 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -102,6 +102,8 @@ current block assignments: - **5100 - 5999** *Reserved for future use* """ +import six + from ipalib.text import ngettext as ungettext from ipalib import messages from ipaplatform.paths import paths @@ -124,6 +126,11 @@ class PrivateError(Exception): setattr(self, key, value) Exception.__init__(self, self.msg) + if six.PY3: + @property + def message(self): + return str(self) + class SubprocessError(PrivateError): """ @@ -251,6 +258,11 @@ class PublicError(Exception): rval = 1 format = None + if six.PY3: + @property + def message(self): + return str(self) + class VersionError(PublicError): """ |