promised-ldap
promised-ldap copied to clipboard
Resolve promise on size limit 'error'
Previously, a SizeLimitExceededError (aka the "expected" result for setting a limit on number of results) would cause the Promise to be rejected. This PR adds a check on whether the search had a sizeLimit and if it did, then take the error as a signal to say "I'm done" and resolve instead. For downstream code, I added a hitSizeLimit flag on the result so it's possible to still resolve the Promise but still know whether the result set was caused by hitting the limit.
Looking at the list of errors (http://ldapjs.org/errors.html), this seems to be the only "error" that is actually a signal to success.
(Same PR as #8 but I needed to change the PR away from my master
branch)