public final class FlowInterruptedException extends InterruptedException
FutureCallback.onFailure(java.lang.Throwable)
to indicate that the flow was aborted from the inside.
(This could be caught like any other exception and rethrown or ignored. It only takes effect if thrown all the way up.)
No stack trace is printed (except by Throwable.getCause()
and/or Throwable.getSuppressed()
if present),
and you can control the Result
and CauseOfInterruption
.
Analogous to Executor.interrupt(Result, CauseOfInterruption...)
but does not assume we are running inside an executor thread.
There is no need to call this from StepExecution.stop(java.lang.Throwable)
since in that case the execution owner
should have set a CauseOfInterruption.UserInterruption
and Result.ABORTED
.
Constructor and Description |
---|
FlowInterruptedException(hudson.model.Result result,
jenkins.model.CauseOfInterruption... causes)
Creates a new exception.
|
Modifier and Type | Method and Description |
---|---|
List<jenkins.model.CauseOfInterruption> |
getCauses() |
hudson.model.Result |
getResult() |
void |
handle(hudson.model.Run<?,?> run,
hudson.model.TaskListener listener)
If a build catches this exception, it should use this method to report it.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
@Nonnull public hudson.model.Result getResult()
public void handle(hudson.model.Run<?,?> run, hudson.model.TaskListener listener)
run
- listener
- Copyright © 2016–2017. All rights reserved.