Added optional LDAP error reporting.