public final class CatchErrorStep extends org.jenkinsci.plugins.workflow.steps.Step implements CatchExecutionOptions
WarningAction
for
advanced visualizations, or to rethrow FlowInterruptedException
rather than continuing execution.Modifier and Type | Class and Description |
---|---|
static class |
CatchErrorStep.DescriptorImpl |
static class |
CatchErrorStep.Execution |
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
CatchErrorStep() |
Modifier and Type | Method and Description |
---|---|
String |
getBuildResult() |
Result |
getBuildResultOnError()
The result that will be used for setting the build result if an error is caught.
|
String |
getMessage()
A message to be printed when an error is caught.
|
String |
getStageResult() |
Result |
getStepResultOnError()
The result that will be used for annotating the with
WarningAction ) if an error is caught. |
boolean |
isCatchInterruptions()
Whether
FlowInterruptedException should be caught and handled by the step or rethrown. |
void |
setBuildResult(String buildResult) |
void |
setCatchInterruptions(boolean catchInterruptions) |
void |
setMessage(String message) |
void |
setStageResult(String stageResult) |
org.jenkinsci.plugins.workflow.steps.StepExecution |
start(org.jenkinsci.plugins.workflow.steps.StepContext context) |
@CheckForNull public String getMessage()
CatchExecutionOptions
CatchExecutionOptions.getStepResultOnError()
(by adding a WarningAction
)getMessage
in interface CatchExecutionOptions
@DataBoundSetter public void setMessage(String message)
@NonNull public Result getBuildResultOnError()
CatchExecutionOptions
Result.SUCCESS
to leave the build result unchanged. If CatchExecutionOptions.isCatchInterruptions()
returns true
, then if a FlowInterruptedException
is caught, its result will be used
instead of this value.getBuildResultOnError
in interface CatchExecutionOptions
@NonNull public String getBuildResult()
@DataBoundSetter public void setBuildResult(String buildResult)
@NonNull public Result getStepResultOnError()
CatchExecutionOptions
WarningAction
) if an error is caught.
Return Result.SUCCESS
to leave the step result unchanged. If CatchExecutionOptions.isCatchInterruptions()
returns true
, then if a FlowInterruptedException
is caught, its result will be used
instead of this value.getStepResultOnError
in interface CatchExecutionOptions
@NonNull public String getStageResult()
@DataBoundSetter public void setStageResult(String stageResult)
public boolean isCatchInterruptions()
CatchExecutionOptions
FlowInterruptedException
should be caught and handled by the step or rethrown.
FlowInterruptedException
is commonly used to control the flow of execution for things
like builds aborted by a user and builds that time out inside of TimeoutStep
. It is
sometimes desirable to rethrow these kinds of exceptions rather than catching them so as to
not interfere with their intended behavior.isCatchInterruptions
in interface CatchExecutionOptions
@DataBoundSetter public void setCatchInterruptions(boolean catchInterruptions)
Copyright © 2016–2022. All rights reserved.