forked from XT-i/aws-lambda-jenkins-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added failure handling for Handled and Unhandled errors
- Loading branch information
Showing
11 changed files
with
157 additions
and
9 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
src/main/java/com/xti/jenkins/plugin/awslambda/AWSLambdaDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.xti.jenkins.plugin.awslambda; | ||
|
||
import hudson.model.Describable; | ||
import hudson.model.Descriptor; | ||
import hudson.util.FormValidation; | ||
import org.apache.commons.lang.StringUtils; | ||
import org.kohsuke.stapler.QueryParameter; | ||
|
||
public abstract class AWSLambdaDescriptor<T extends Describable<T>> extends Descriptor<T> { | ||
|
||
//awsAccessKeyId field | ||
public FormValidation doCheckAwsAccessKeyId(@QueryParameter String value) { | ||
if(StringUtils.isEmpty(value)){ | ||
return FormValidation.error("Please fill in AWS Access Key Id."); | ||
} else { | ||
return FormValidation.ok(); | ||
} | ||
} | ||
|
||
//awsSecretKey field | ||
public FormValidation doCheckAwsSecretKey(@QueryParameter String value) { | ||
if(StringUtils.isEmpty(value)){ | ||
return FormValidation.error("Please fill in AWS Secret Id."); | ||
} else { | ||
return FormValidation.ok(); | ||
} | ||
} | ||
|
||
//awsRegion field | ||
public FormValidation doCheckAwsRegion(@QueryParameter String value) { | ||
if(StringUtils.isEmpty(value)){ | ||
return FormValidation.error("Please fill in AWS Region."); | ||
} else { | ||
return FormValidation.ok(); | ||
} | ||
} | ||
|
||
//functionName field | ||
public FormValidation doCheckFunctionName(@QueryParameter String value) { | ||
if(StringUtils.isEmpty(value)){ | ||
return FormValidation.error("Please fill in AWS Lambda function name."); | ||
} else { | ||
return FormValidation.ok(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/com/xti/jenkins/plugin/awslambda/exception/LambdaInvokeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.xti.jenkins.plugin.awslambda.exception; | ||
|
||
public class LambdaInvokeException extends RuntimeException { | ||
public LambdaInvokeException(String message) { | ||
super(message); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/xti/jenkins/plugin/awslambda/invoke/AWSInvokeDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.xti.jenkins.plugin.awslambda.invoke; | ||
|
||
import com.xti.jenkins.plugin.awslambda.AWSLambdaDescriptor; | ||
import hudson.model.Describable; | ||
|
||
public abstract class AWSInvokeDescriptor<T extends Describable<T>> extends AWSLambdaDescriptor<T> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters