Bug 49653 - More filigran exceptions for univention.admin.uldap
More filigran exceptions for univention.admin.uldap
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-06-14 12:40 CEST by Florian Best
Modified: 2019-06-14 12:40 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, Troubleshooting
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 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