MCPcopy Index your code
hub / github.com/BoltsFramework/Bolts-Java / trySetError

Method trySetError

Bolts/src/bolts/Task.java:601–612  ·  view source on GitHub ↗

Sets the error on the Task if the Task hasn't already been completed.

(Exception error)

Source from the content-addressed store, hash-verified

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.

Callers 1

setErrorMethod · 0.95

Calls 1

runContinuationsMethod · 0.80

Tested by

no test coverage detected