detect some errors in LDAP auth and throw exceptions