diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-06-09 15:24:23 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-07-10 16:44:54 -0400 |
commit | fe84ffd0f1dfbdea158a07f177a174f41b803723 (patch) | |
tree | 7ff47956feaef673f7f0a98104fd4a7110a0bc7e /ipalib/errors.py | |
parent | 0e29dd7226119e69f3bf123395251140ad4260ca (diff) | |
download | freeipa-fe84ffd0f1dfbdea158a07f177a174f41b803723.tar.gz freeipa-fe84ffd0f1dfbdea158a07f177a174f41b803723.tar.xz freeipa-fe84ffd0f1dfbdea158a07f177a174f41b803723.zip |
Add a return value to exceptions.
Returning the exception value doesn't work because a shell return value
is in the range of 0-255.
The default return value is 1 which means "something went wrong." The only
specific return value implemented so far is 2 which is "not found".
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index a08ee959..82905b39 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -240,6 +240,7 @@ class PublicError(StandardError): """ errno = 900 + rval = 1 format = None def __init__(self, format=None, message=None, **kw): @@ -748,6 +749,7 @@ class NotFound(ExecutionError): """ errno = 4001 + rval = 2 format = _('%(reason)s') class DuplicateEntry(ExecutionError): |