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