- 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:
kohsuke 2010-03-30 22:41:24 +00:00
parent e1361780ea
commit 92d1ac3811

View file

@ -519,12 +519,12 @@ public class LDAPSecurityRealm extends SecurityRealm {
} catch (UnknownHostException x) {
return FormValidation.error(Messages.LDAPSecurityRealm_UnknownHost(x.getMessage()));
} 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
// 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) {
// The getLdapCtxInstance method throws this if it fails to parse the port number
return FormValidation.error(Messages.LDAPSecurityRealm_InvalidPortNumber());