I have a LDAP server request in my code. I open an connection with ldap_connect
and check that returned descriptor is valid, but then I make a search request with ldap_search
using the open descriptor. But sometimes due to the network failure or something else, ldap_search
fails with warning Search: Can't contact LDAP server
.
On my production server I treat all warnings as fatal errors, so the whole page render fails.
Should I just prepend ldap_search
with @
and just check the value returned (I do check it now as well) or there's a better way to handle this?