From fe84ffd0f1dfbdea158a07f177a174f41b803723 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 9 Jun 2009 15:24:23 -0400 Subject: 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". --- ipalib/errors.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ipalib/errors.py') diff --git a/ipalib/errors.py b/ipalib/errors.py index a08ee959a..82905b391 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): -- cgit