Skip to content
Browse files
[FIXED JENKINS-24676]: Give the user a readable error message when te…
…sting the connection instead of stack trace if their credentials are incorrect.
  • Loading branch information
recampbell committed Sep 12, 2014
1 parent 7fe8fdf commit 954f599463dac1b5a4c52f8256c7188e12691d4d
Showing 1 changed file with 6 additions and 0 deletions.
@@ -24,6 +24,7 @@
package hudson.plugins.ec2;

import hudson.Extension;
import hudson.Util;
import hudson.slaves.Cloud;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
@@ -146,6 +147,11 @@ public FormValidation doTestConnection(
@QueryParameter String accessId,
@QueryParameter String secretKey,
@QueryParameter String privateKey) throws IOException, ServletException {

if (Util.fixEmpty(region) == null) {
region = DEFAULT_EC2_HOST;

return super.doTestConnection(getEc2EndpointUrl(region),accessId,secretKey,privateKey);

0 comments on commit 954f599

Please sign in to comment.