Class ErrorCondition
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<ErrorCondition>
-
- org.jenkinsci.plugins.workflow.flow.ErrorCondition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ErrorCondition>
,Serializable
@Restricted(org.kohsuke.accmod.restrictions.Beta.class) public abstract class ErrorCondition extends AbstractDescribableImpl<ErrorCondition> implements ExtensionPoint, Serializable
User-configurable predicate for errors that may occur during a build. Implementations could check for agent-related outages, for example. Step callers could use a condition to decide whether to ignore or report an error, retry, etc.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ErrorCondition.ErrorConditionDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description ErrorCondition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ErrorCondition.ErrorConditionDescriptor
getDescriptor()
abstract boolean
test(Throwable error, org.jenkinsci.plugins.workflow.steps.StepContext context)
Checks whether a given error matches this condition.
-
-
-
Method Detail
-
test
public abstract boolean test(@NonNull Throwable error, @CheckForNull org.jenkinsci.plugins.workflow.steps.StepContext context) throws IOException, InterruptedException
Checks whether a given error matches this condition.- Parameters:
error
- some exception thrown during a buildcontext
- the context in which the error is being handled, if available;ErrorAction.findOrigin(java.lang.Throwable, org.jenkinsci.plugins.workflow.flow.FlowExecution)
could be used to determine the part of the build in which the error was thrown- Returns:
- true if the error is recognized
- Throws:
IOException
- as perStepContext.get(java.lang.Class<T>)
InterruptedException
- as perStepContext.get(java.lang.Class<T>)
-
getDescriptor
public ErrorCondition.ErrorConditionDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<ErrorCondition>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<ErrorCondition>
-
-