Class CatchErrorStep

  • All Implemented Interfaces:
    ExtensionPoint, Describable<org.jenkinsci.plugins.workflow.steps.Step>, Serializable, CatchExecutionOptions

    public final class CatchErrorStep
    extends org.jenkinsci.plugins.workflow.steps.Step
    implements CatchExecutionOptions
    Runs a block. By default, if that block fails, marks the build as failed, but continues execution. Can be customized to print a message when the block fails, to set a different build result, to annotate the step with WarningAction for advanced visualizations, or to rethrow FlowInterruptedException rather than continuing execution.
    See Also:
    Serialized Form
    • Constructor Detail

      • CatchErrorStep

        @DataBoundConstructor
        public CatchErrorStep()
    • Method Detail

      • setMessage

        @DataBoundSetter
        public void setMessage​(String message)
      • getBuildResult

        @NonNull
        public String getBuildResult()
      • setBuildResult

        @DataBoundSetter
        public void setBuildResult​(String buildResult)
      • getStageResult

        @NonNull
        public String getStageResult()
      • setStageResult

        @DataBoundSetter
        public void setStageResult​(String stageResult)
      • isCatchInterruptions

        public boolean isCatchInterruptions()
        Description copied from interface: CatchExecutionOptions
        Whether 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.
        Specified by:
        isCatchInterruptions in interface CatchExecutionOptions
      • setCatchInterruptions

        @DataBoundSetter
        public void setCatchInterruptions​(boolean catchInterruptions)
      • start

        public org.jenkinsci.plugins.workflow.steps.StepExecution start​(org.jenkinsci.plugins.workflow.steps.StepContext context)
                                                                 throws Exception
        Specified by:
        start in class org.jenkinsci.plugins.workflow.steps.Step
        Throws:
        Exception