Make sure to catch exceptions when searching for the user in LDAP, log as error and fail gracefully by declining login.