8000 Add verbose ext-ldap error if present for easier debugging · symfony/symfony@761415f · GitHub
[go: up one dir, main page]

Skip to content

Commit 761415f

Browse files
committed
Add verbose ext-ldap error if present for easier debugging
1 parent 2879baf commit 761415f

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
< 9EA4 table aria-label="Diff for: src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php" class="tab-size width-full DiffLines-module__tableLayoutFixed--YZcIJ" data-diff-anchor="diff-24b79f3ac1a99938f5acb158a450e38d30c1984a5d333b5b20f2c38a73d10e31" data-tab-size="8" data-paste-markdown-skip="true" role="grid" style="--line-number-cell-width:44px;--line-number-cell-width-unified:88px">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 ($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)
0