Home | Trees | Indices | Help |
|
---|
|
1 # Twisted, the Framework of Your Internet 2 # Copyright (C) 2001 Matthew W. Lefkowitz 3 # 4 # This library is free software; you can redistribute it and/or 5 # modify it under the terms of version 2.1 of the GNU Lesser General Public 6 # License as published by the Free Software Foundation. 7 # 8 # This library is distributed in the hope that it will be useful, 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 # Lesser General Public License for more details. 12 # 13 # You should have received a copy of the GNU Lesser General Public 14 # License along with this library; if not, write to the Free Software 15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 17 # make pyflakes not complain about undefined names 18 reverse = None 19 LDAPOther = None 2022 """Get an instance of the correct exception for this resultCode.""" 23 24 klass = reverse.get(resultCode) 25 if klass is not None: 26 return klass(errorMessage) 27 else: 28 return LDAPUnknownError(resultCode, errorMessage)29 33 40 5961 resultCode=None 6275 76 import new64 assert resultCode not in reverse, \ 65 "resultCode %r must be unknown" % resultCode 66 self.code=resultCode 67 LDAPException.__init__(self, message)6878 global reverse 79 reverse = {} 80 for name, value in errors.items(): 81 if value == errors['success']: 82 klass = Success 83 else: 84 classname = 'LDAP'+name[0].upper()+name[1:] 85 klass = new.classobj(classname, 86 (LDAPException,), 87 { 'resultCode': value, 88 'name': name, 89 }) 90 globals()[classname] = klass 91 reverse[value] = klass92 93 init( 94 success=0, 95 operationsError=1, 96 protocolError=2, 97 timeLimitExceeded=3, 98 sizeLimitExceeded=4, 99 compareFalse=5, 100 compareTrue=6, 101 authMethodNotSupported=7, 102 strongAuthRequired=8, 103 # 9 reserved 104 referral=10 , 105 adminLimitExceeded=11 , 106 unavailableCriticalExtension=12 , 107 confidentialityRequired=13 , 108 saslBindInProgress=14 , 109 noSuchAttribute=16, 110 undefinedAttributeType=17, 111 inappropriateMatching=18, 112 constraintViolation=19, 113 attributeOrValueExists=20, 114 invalidAttributeSyntax=21, 115 # 22-31 unused 116 noSuchObject=32, 117 aliasProblem=33, 118 invalidDNSyntax=34, 119 # 35 reserved for undefined isLeaf 120 aliasDereferencingProblem=36, 121 # 37-47 unused 122 inappropriateAuthentication=48, 123 invalidCredentials=49, 124 insufficientAccessRights=50, 125 busy=51, 126 unavailable=52, 127 unwillingToPerform=53, 128 loopDetect=54, 129 # 55-63 unused 130 namingViolation=64, 131 objectClassViolation=65, 132 notAllowedOnNonLeaf=66, 133 notAllowedOnRDN=67, 134 entryAlreadyExists=68, 135 objectClassModsProhibited=69, 136 # 70 reserved for CLDAP 137 affectsMultipleDSAs=71, 138 # 72-79 unused 139 other=80, 140 # 81-90 reserved for APIs 141 ) 142 143 other=LDAPOther.resultCode 144
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jan 8 20:56:56 2014 | http://epydoc.sourceforge.net |