Skip to content

Commit

Permalink
[FIXED JENKINS-24676]: Give the user a readable error message when te…
Browse files Browse the repository at this point in the history
…sting the connection instead of stack trace if their credentials are incorrect.
  • Loading branch information
recampbell committed Sep 12, 2014
1 parent 7fe8fdf commit 954f599
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/hudson/plugins/ec2/AmazonEC2Cloud.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 954f599

Please sign in to comment.