diff --git a/ldapserver/exceptions.py b/ldapserver/exceptions.py index 69a45dfb8b4cf87bda8063cf02edc07151bb2e90..109e310e9bdef75e1308e4d6b11eb248b04805fa 100644 --- a/ldapserver/exceptions.py +++ b/ldapserver/exceptions.py @@ -3,126 +3,126 @@ from .ldap import LDAPResultCode class LDAPError(Exception): '''Base class for all LDAP errors''' - result_code = None + RESULT_CODE: LDAPResultCode def __init__(self, message=''): super().__init__() - self.code = self.result_code + self.code = self.RESULT_CODE self.message = message #class LDAPSuccess(LDAPError): -# result_code = LDAPResultCode.success +# RESULT_CODE = LDAPResultCode.success class LDAPOperationsError(LDAPError): - result_code = LDAPResultCode.operationsError + RESULT_CODE = LDAPResultCode.operationsError class LDAPProtocolError(LDAPError): - result_code = LDAPResultCode.protocolError + RESULT_CODE = LDAPResultCode.protocolError class LDAPTimeLimitExceeded(LDAPError): - result_code = LDAPResultCode.timeLimitExceeded + RESULT_CODE = LDAPResultCode.timeLimitExceeded class LDAPSizeLimitExceeded(LDAPError): - result_code = LDAPResultCode.sizeLimitExceeded + RESULT_CODE = LDAPResultCode.sizeLimitExceeded #class LDAPCompareFalse(LDAPError): -# result_code = LDAPResultCode.compareFalse +# RESULT_CODE = LDAPResultCode.compareFalse #class LDAPCompareTrue(LDAPError): -# result_code = LDAPResultCode.compareTrue +# RESULT_CODE = LDAPResultCode.compareTrue class LDAPAuthMethodNotSupported(LDAPError): - result_code = LDAPResultCode.authMethodNotSupported + RESULT_CODE = LDAPResultCode.authMethodNotSupported class LDAPStrongerAuthRequired(LDAPError): - result_code = LDAPResultCode.strongerAuthRequired + RESULT_CODE = LDAPResultCode.strongerAuthRequired #class LDAPReferral(LDAPError): -# result_code = LDAPResultCode.referral +# RESULT_CODE = LDAPResultCode.referral class LDAPAdminLimitExceeded(LDAPError): - result_code = LDAPResultCode.adminLimitExceeded + RESULT_CODE = LDAPResultCode.adminLimitExceeded class LDAPUnavailableCriticalExtension(LDAPError): - result_code = LDAPResultCode.unavailableCriticalExtension + RESULT_CODE = LDAPResultCode.unavailableCriticalExtension class LDAPConfidentialityRequired(LDAPError): - result_code = LDAPResultCode.confidentialityRequired + RESULT_CODE = LDAPResultCode.confidentialityRequired #class LDAPSaslBindInProgress(LDAPError): -# result_code = LDAPResultCode.saslBindInProgress +# RESULT_CODE = LDAPResultCode.saslBindInProgress class LDAPNoSuchAttribute(LDAPError): - result_code = LDAPResultCode.noSuchAttribute + RESULT_CODE = LDAPResultCode.noSuchAttribute class LDAPUndefinedAttributeType(LDAPError): - result_code = LDAPResultCode.undefinedAttributeType + RESULT_CODE = LDAPResultCode.undefinedAttributeType class LDAPInappropriateMatching(LDAPError): - result_code = LDAPResultCode.inappropriateMatching + RESULT_CODE = LDAPResultCode.inappropriateMatching class LDAPConstraintViolation(LDAPError): - result_code = LDAPResultCode.constraintViolation + RESULT_CODE = LDAPResultCode.constraintViolation class LDAPAttributeOrValueExists(LDAPError): - result_code = LDAPResultCode.attributeOrValueExists + RESULT_CODE = LDAPResultCode.attributeOrValueExists class LDAPInvalidAttributeSyntax(LDAPError): - result_code = LDAPResultCode.invalidAttributeSyntax + RESULT_CODE = LDAPResultCode.invalidAttributeSyntax class LDAPNoSuchObject(LDAPError): - result_code = LDAPResultCode.noSuchObject + RESULT_CODE = LDAPResultCode.noSuchObject class LDAPAliasProblem(LDAPError): - result_code = LDAPResultCode.aliasProblem + RESULT_CODE = LDAPResultCode.aliasProblem class LDAPInvalidDNSyntax(LDAPError): - result_code = LDAPResultCode.invalidDNSyntax + RESULT_CODE = LDAPResultCode.invalidDNSyntax class LDAPAliasDereferencingProblem(LDAPError): - result_code = LDAPResultCode.aliasDereferencingProblem + RESULT_CODE = LDAPResultCode.aliasDereferencingProblem class LDAPInappropriateAuthentication(LDAPError): - result_code = LDAPResultCode.inappropriateAuthentication + RESULT_CODE = LDAPResultCode.inappropriateAuthentication class LDAPInvalidCredentials(LDAPError): - result_code = LDAPResultCode.invalidCredentials + RESULT_CODE = LDAPResultCode.invalidCredentials class LDAPInsufficientAccessRights(LDAPError): - result_code = LDAPResultCode.insufficientAccessRights + RESULT_CODE = LDAPResultCode.insufficientAccessRights class LDAPBusy(LDAPError): - result_code = LDAPResultCode.busy + RESULT_CODE = LDAPResultCode.busy class LDAPUnavailable(LDAPError): - result_code = LDAPResultCode.unavailable + RESULT_CODE = LDAPResultCode.unavailable class LDAPUnwillingToPerform(LDAPError): - result_code = LDAPResultCode.unwillingToPerform + RESULT_CODE = LDAPResultCode.unwillingToPerform class LDAPLoopDetect(LDAPError): - result_code = LDAPResultCode.loopDetect + RESULT_CODE = LDAPResultCode.loopDetect class LDAPNamingViolation(LDAPError): - result_code = LDAPResultCode.namingViolation + RESULT_CODE = LDAPResultCode.namingViolation class LDAPObjectClassViolation(LDAPError): - result_code = LDAPResultCode.objectClassViolation + RESULT_CODE = LDAPResultCode.objectClassViolation class LDAPNotAllowedOnNonLeaf(LDAPError): - result_code = LDAPResultCode.notAllowedOnNonLeaf + RESULT_CODE = LDAPResultCode.notAllowedOnNonLeaf class LDAPNotAllowedOnRDN(LDAPError): - result_code = LDAPResultCode.notAllowedOnRDN + RESULT_CODE = LDAPResultCode.notAllowedOnRDN class LDAPEntryAlreadyExists(LDAPError): - result_code = LDAPResultCode.entryAlreadyExists + RESULT_CODE = LDAPResultCode.entryAlreadyExists class LDAPObjectClassModsProhibited(LDAPError): - result_code = LDAPResultCode.objectClassModsProhibited + RESULT_CODE = LDAPResultCode.objectClassModsProhibited class LDAPAffectsMultipleDSAs(LDAPError): - result_code = LDAPResultCode.affectsMultipleDSAs + RESULT_CODE = LDAPResultCode.affectsMultipleDSAs class LDAPOther(LDAPError): - result_code = LDAPResultCode.other + RESULT_CODE = LDAPResultCode.other