error handling for ldap