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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanChecks whether a given error matches this condition.
-
Constructor Details
-
ErrorCondition
public ErrorCondition()
-
-
Method Details
-
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
- Specified by:
getDescriptorin interfaceDescribable<ErrorCondition>- Overrides:
getDescriptorin classAbstractDescribableImpl<ErrorCondition>
-