Class ErrorAction
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.actions.ErrorAction
-
- All Implemented Interfaces:
Action
,ModelObject
,PersistentAction
public class ErrorAction extends Object implements PersistentAction
Attached toFlowNode
that caused an error. This has to be Action because it's added after a node is created.
-
-
Constructor Summary
Constructors Constructor Description ErrorAction(Throwable error)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FlowNode
findOrigin(Throwable error, FlowExecution execution)
Attempts to locate the first node of a build which threw an error.String
getDisplayName()
Throwable
getError()
String
getIconFileName()
String
getUrlName()
-
-
-
Constructor Detail
-
ErrorAction
public ErrorAction(@NonNull Throwable error)
-
-
Method Detail
-
getError
@NonNull public Throwable getError()
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
findOrigin
@CheckForNull public static FlowNode findOrigin(@NonNull Throwable error, @NonNull FlowExecution execution)
Attempts to locate the first node of a build which threw an error. Typically an error will be rethrown by enclosing blocks, so this will look for the original node with anErrorAction
matching the given stack trace.- Parameters:
error
- an error thrown at some point during a buildexecution
- the build- Returns:
- the originating node, if one can be located;
typically an
AtomNode
orBlockEndNode
(in the latter case you may want to useBlockEndNode.getStartNode()
to look up actions)
-
-