Univention Bugzilla – Bug 49653
More filigran exceptions for univention.admin.uldap
Last modified: 2019-06-14 12:40:13 CEST
Unfortionately univention.admin.uldap.access masks a lot of LDAPError exceptions with the univention.admin.uexceptions.ldapError exception. This should be improoved by making these exceptions more filigran. To be backwards compatible, we could create new classes which inherit from uexceptions.ldapError: uexceptions.ldapServerDown() for ldap.SERVER_DOWN. uexceptions.invalidDNSyntax() for ldap.INVALID_DN_SYNTAX. uexceptions.invalidFilter() for ldap.FILTER_ERROR. … For all exceptions, where it makes sense for us: >>> import inspect, _ldap >>> print '\n'.join(dict(inspect.getmembers(_ldap, lambda m: inspect.isclass(m) and issubclass(m, _ldap.LDAPError))).keys()) I saw at least the above and the following exceptions in my lifetime, which should get better descriptions and can be handled separately: UNWILLING_TO_PERFORM, BUSY, CONSTRAINT_VIOLATION, OTHER, CONNECT_ERROR, PROTOCOL_ERROR, INAPPROPRIATE_MATCHING, UNAVAILABLE