Improve readability of ldap error handling