saker.build Documentation TaskDoc JavaDoc Packages
public interface InnerTaskResultHolder<R>
Interface holding the results of an inner task invocation.

The result of an inner task invocation is either successful or failed.
If it was successful, getResult() will return the object that was returned from the Task.run(TaskContext) method.
If not, then getResult() will throw an appropriate exception, and getExceptionIfAny() will return the exception that was thrown by the task.

If the callers are only interested if the task finished successfully, they should use getExceptionIfAny(), which can avoid throwing unnecessary exceptions.

RThe type of the task result.
Methods
public Throwable
Gets the exception that was thrown by the task execution if any, or the aborted exception.
public R
Gets the result of the inner task execution, or throws an exception if it threw an exception.
Gets the exception that was thrown by the task execution if any, or the aborted exception.

If the task execution finished successfully, this method will return null.

The exception that was thrown by the task.
Gets the result of the inner task execution, or throws an exception if it threw an exception.

This method will return the object that was returned from the Task.run(TaskContext) method of the inner task. If the call threw an exception before finishing properly, this method will throw an InnerTaskExecutionException with its cause set to the thrown exception.

If the inner task failed by calling TaskContext.abortExecution(Throwable), then this method will still return the object that the inner task returned from Task.run(TaskContext).
To get the aborted exception, use getExceptionIfAny().

The result of the task execution.
InnerTaskExecutionExceptionIf the task execution failed.