I have a primary ldap server url, say urlA and multiple backup server urls in a list. If the connection couldn't be made to the primary ldap server, the backup servers will be tried in the order they appear in the list. I am using ldapjs createClient function to create a client. ldapjs.createClient({ url: urlA })
How do I handle a connection error and retry on backup server in order till I connect to one of them?