diff options
author | John Dennis <jdennis@redhat.com> | 2009-11-19 11:16:30 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-11-19 14:52:17 -0500 |
commit | 0d880b3ee394c806432b232ec854f899708afaa4 (patch) | |
tree | e5eed160ec92abcb02ec5595a21c037e5f4b3d69 /ipalib/errors.py | |
parent | 76fc1f75f90925be128820e61a3d3e31c4c2ca06 (diff) | |
download | freeipa-0d880b3ee394c806432b232ec854f899708afaa4.tar.gz freeipa-0d880b3ee394c806432b232ec854f899708afaa4.tar.xz freeipa-0d880b3ee394c806432b232ec854f899708afaa4.zip |
add new error class for certificate operations
add new error class for certificate operations
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index ca1851c56..d94d2b070 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -89,7 +89,9 @@ current block assignments: - **4200 - 4299** `LDAPError` and its subclasses - - **4300 - 4999** *Reserved for future use* + - **4300 - 4399** `CertificateError` and its subclasses + + - **4400 - 4999** *Reserved for future use* - **5000 - 5999** `GenericError` and its subclasses @@ -1155,6 +1157,31 @@ class ObjectclassViolation(ExecutionError): format = _('%(info)s') +class CertificateError(ExecutionError): + """ + **4300** Base class for Certificate execution errors (*4300 - 4399*). + """ + + errno = 4300 + + +class CertificateOperationError(ExecutionError): + """ + **4301** Raised when a certificate operation cannot be completed + + For example: + + >>> raise CertificateOperationError(error=u'bad serial number') + Traceback (most recent call last): + ... + CertificateOperationError: Certificate operation cannot be completed: bad serial number + + """ + + errno = 4301 + format = _('Certificate operation cannot be completed: %(error)s') + + ############################################################################## # 5000 - 5999: Generic errors |