diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-01-28 21:47:21 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-03 15:29:04 -0500 |
commit | 5717c9d6689f15c46801f2d251e174fad4ce4748 (patch) | |
tree | 31e2a3378638bd63005a3d65d7fe74159860456c /ipalib/errors2.py | |
parent | 48a278047db50f919a45ef82a57a6983804ed523 (diff) | |
download | freeipa-5717c9d6689f15c46801f2d251e174fad4ce4748.tar.gz freeipa-5717c9d6689f15c46801f2d251e174fad4ce4748.tar.xz freeipa-5717c9d6689f15c46801f2d251e174fad4ce4748.zip |
Applied Rob's errors patch
Diffstat (limited to 'ipalib/errors2.py')
-rw-r--r-- | ipalib/errors2.py | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/ipalib/errors2.py b/ipalib/errors2.py index 4a6a517dd..83ea2aab4 100644 --- a/ipalib/errors2.py +++ b/ipalib/errors2.py @@ -599,6 +599,85 @@ class ExecutionError(PublicError): errno = 4000 +class NotFound(ExecutionError): + """ + **4001** Raised when an entry is not found. + + For example: + + >>> raise NotFound(msg='Entry not found') + Traceback (most recent call last): + ... + NotFound: Entry not found + + """ + + errno = 4001 + format = _('%(msg)s') + +class DuplicateEntry(ExecutionError): + """ + **4002** Raised when an entry already exists. + + For example: + + >>> raise DuplicateEntry + Traceback (most recent call last): + ... + DuplicateEntry: This entry already exists + + """ + + errno = 4002 + format = _('This entry already exists') + +class HostService(ExecutionError): + """ + **4003** Raised when a host service principal is requested + + For example: + + >>> raise HostService + Traceback (most recent call last): + ... + HostService: You must enroll a host in order to create a host service + + """ + + errno = 4003 + format = _('You must enroll a host in order to create a host service') + +class MalformedServicePrincipal(ExecutionError): + """ + **4004** Raised when a service principal is not of the form: service/fully-qualified host name + + For example: + + >>> raise MalformedServicePrincipal + Traceback (most recent call last): + ... + MalformedServicePrincipal: Service principal is not of the form: service/fully-qualified host name + + """ + + errno = 4004 + format = _('Service principal is not of the form: service/fully-qualified host name') + +class RealmMismatch(ExecutionError): + """ + **4005** Raised when the requested realm does not match the IPA realm + + For example: + + >>> raise RealmMismatch + Traceback (most recent call last): + ... + RealmMismatch: The realm for the principal does not match the realm for this IPA server + + """ + + errno = 4005 + format = _('The realm for the principal does not match the realm for this IPA server') class BuiltinError(ExecutionError): """ |