Sets the error on the Task if the Task hasn't already been completed.
(Exception error)
| 599 | * Sets the error on the Task if the Task hasn't already been completed. |
| 600 | */ |
| 601 | public boolean trySetError(Exception error) { |
| 602 | synchronized (lock) { |
| 603 | if (complete) { |
| 604 | return false; |
| 605 | } |
| 606 | complete = true; |
| 607 | Task.this.error = error; |
| 608 | lock.notifyAll(); |
| 609 | runContinuations(); |
| 610 | return true; |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | /** |
| 615 | * Sets the cancelled flag on the task, throwing if the Task has already been completed. |
no test coverage detected