Handle externalldap errors correctly in settings route
This commit is contained in:
@@ -83,7 +83,7 @@ function testConfig(config, callback) {
|
||||
client = ldap.createClient({ url: config.url });
|
||||
} catch (e) {
|
||||
if (e instanceof ldap.ProtocolError) return callback(new ExternalLdapError(ExternalLdapError.BAD_FIELD, 'url protocol is invalid'));
|
||||
return callback(new ExternalLdapError(ExternalLdapError.INTERNAL_ERROR, e));
|
||||
return callback(new ExternalLdapError(ExternalLdapError.EXTERNAL_ERROR, e));
|
||||
}
|
||||
|
||||
if (!config.bindDn) return callback(null, client);
|
||||
|
||||
Reference in New Issue
Block a user