mirror of
https://github.com/nicolabs/ldap-plugin.git
synced 2025-09-07 05:14:24 +02:00
- Improved the error reporting mechanism in LDAP setting.
- improved FormValidation.error(...) so that one can easily send the full stack trace. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29612 71c3de6d-444a-0410-be80-ed276b4c234a Originally-Committed-As: a168fc472af52fcf4f3f4f3dbdccb1cf807a4c56
This commit is contained in:
parent
e1361780ea
commit
92d1ac3811
|
@ -519,12 +519,12 @@ public class LDAPSecurityRealm extends SecurityRealm {
|
||||||
} catch (UnknownHostException x) {
|
} catch (UnknownHostException x) {
|
||||||
return FormValidation.error(Messages.LDAPSecurityRealm_UnknownHost(x.getMessage()));
|
return FormValidation.error(Messages.LDAPSecurityRealm_UnknownHost(x.getMessage()));
|
||||||
} catch (IOException x) {
|
} catch (IOException x) {
|
||||||
return FormValidation.error(Messages.LDAPSecurityRealm_UnableToConnect(server, x.getMessage()));
|
return FormValidation.error(x,Messages.LDAPSecurityRealm_UnableToConnect(server, x.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise we don't know what caused it, so fall back to the general error report
|
// otherwise we don't know what caused it, so fall back to the general error report
|
||||||
// getMessage() alone doesn't offer enough
|
// getMessage() alone doesn't offer enough
|
||||||
return FormValidation.error(Messages.LDAPSecurityRealm_UnableToConnect(server, e));
|
return FormValidation.error(e,Messages.LDAPSecurityRealm_UnableToConnect(server, e));
|
||||||
} catch (NumberFormatException x) {
|
} catch (NumberFormatException x) {
|
||||||
// The getLdapCtxInstance method throws this if it fails to parse the port number
|
// The getLdapCtxInstance method throws this if it fails to parse the port number
|
||||||
return FormValidation.error(Messages.LDAPSecurityRealm_InvalidPortNumber());
|
return FormValidation.error(Messages.LDAPSecurityRealm_InvalidPortNumber());
|
||||||
|
|
Loading…
Reference in a new issue