-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Ldap] Add verbose ext-ldap error if present for easier debugging #28424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ba2d6f0
to
0845126
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(with minor comment)
@@ -89,7 +89,12 @@ public function execute() | |||
} | |||
|
|||
if (false === $this->search) { | |||
throw new LdapException(sprintf('Could not complete search with dn "%s", query "%s" and filters "%s".', $this->dn, $this->query, implode(',', $this->options['filter']))); | |||
$ldapError = ''; | |||
if (0 !== ($errno = ldap_errno($con))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to write this as if ($errno = ldap_errno($con)) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hoped to find something like LDAP_ERROR_NONE
for better readability, but failed. Initial idea was
if (LDAP_ERROR_NONE !== ($errno = ldap_errno($con))) {
Without that your suggestion looks better, indeed, I'll fix it
(to be merged on master actually as that's not a bug fix but an improvement.) |
0845126
to
fb861a6
Compare
@nicolas-grekas should I rebase? |
@scaytrase if you can please yes, otherwise no worries we'll take care of it. |
fb861a6
to
761415f
Compare
rebased |
Thank you @scaytrase. |
…r debugging (scaytrase) This PR was merged into the 4.2-dev branch. Discussion ---------- [Ldap] Add verbose ext-ldap error if present for easier debugging | Q | A | ------------- | --- | Branch? | master (be careful when merging) | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | | Fixed tickets | #28149 | License | MIT | Doc PR | Added an optional message suffix if ldap_errno is not equals to 0 Commits ------- 761415f Add verbose ext-ldap error if present for easier debugging
Added an optional message suffix if ldap_errno is not equals to 0