MCPcopy Create free account
hub / github.com/BoltsFramework/Bolts-Java / forError

Method forError

Bolts/src/bolts/Task.java:177–181  ·  view source on GitHub ↗

Creates a faulted task with the given error.

(Exception error)

Source from the content-addressed store, hash-verified

175 * Creates a faulted task with the given error.
176 */
177 public static <TResult> Task<TResult> forError(Exception error) {
178 Task<TResult>.TaskCompletionSource tcs = Task.<TResult> create();
179 tcs.setError(error);
180 return tcs.getTask();
181 }
182
183 /**
184 * Creates a cancelled task with the given error.

Callers 5

testPrimitivesMethod · 0.95
testOnSuccessMethod · 0.95
testOnSuccessTaskMethod · 0.95
thenMethod · 0.95

Calls 3

createMethod · 0.95
setErrorMethod · 0.80
getTaskMethod · 0.80

Tested by 4

testPrimitivesMethod · 0.76
testOnSuccessMethod · 0.76
testOnSuccessTaskMethod · 0.76