Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba2d6f0

Browse files
committed
Add verbose ext-ldap error if present for easier debugging
1 parent 90e7945 commit ba2d6f0

File tree

1 file changed

+6
-1
lines changed
  • src/Symfony/Component/Ldap/Adapter/ExtLdap

1 file changed

+6
-1
lines changed

src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ public function execute()
8989
}
9090

9191
if (false === $this->search) {
92-
throw new LdapException(sprintf('Could not complete search with dn "%s", query "%s" and filters "%s".', $this->dn, $this->query, implode(',', $this->options['filter'])));
92+
$ldapError = '';
93+
if (0 !== ($errno = ldap_errno($con))) {
94+
$ldapError = sprintf('. LDAP error was [%d] %s', $errno, ldap_error($con));
95+
}
96+
97+
throw new LdapException(sprintf('Could not complete search with dn "%s", query "%s" and filters "%s".%s', $this->dn, $this->query, implode(',', $this->options['filter']), $ldapError));
9398
}
9499

95100
return new Collection($this->connection, $this);

0 commit comments

Comments
 (0)