From 0d538b20f2b50c76a460be407b9be8a94ee379e9 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 5 May 2009 14:46:47 -0400 Subject: Make MalformedServicePrincipal take a reason arg and add Base64DecodeError --- ipalib/errors.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'ipalib/errors.py') diff --git a/ipalib/errors.py b/ipalib/errors.py index f626f359d..2e9eebeef 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -779,15 +779,15 @@ class MalformedServicePrincipal(ExecutionError): For example: - >>> raise MalformedServicePrincipal + >>> raise MalformedServicePrincipal(reason="missing service") Traceback (most recent call last): ... - MalformedServicePrincipal: Service principal is not of the form: service/fully-qualified host name + MalformedServicePrincipal: Service principal is not of the form: service/fully-qualified host name: missing service """ errno = 4004 - format = _('Service principal is not of the form: service/fully-qualified host name') + format = _('Service principal is not of the form: service/fully-qualified host name: %(reason)r') class RealmMismatch(ExecutionError): """ @@ -949,6 +949,22 @@ class AlreadyGroupMember(ExecutionError): errno = 4014 format = _('This entry is already a member of the group') +class Base64DecodeError(ExecutionError): + """ + **4015** Raised when a base64-encoded blob cannot decoded + + For example: + + >>> raise Base64DecodeError(reason="Incorrect padding") + Traceback (most recent call last): + ... + Base64DecodeError: Base64 decoding failed: Incorrect padding + + """ + + errno = 4015 + format = _('Base64 decoding failed: %(reason)r') + class BuiltinError(ExecutionError): """ **4100** Base class for builtin execution errors (*4100 - 4199*). -- cgit