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(
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.
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. |
If the task execution finished successfully, this method will return null
.
This method will return the object that was returned from the Task.run(
If the inner task failed by calling TaskContext.abortExecution(
To get the aborted exception, use getExceptionIfAny().