Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f73e551

Browse files
committedJan 20, 2017
fix(resolve): Fix 'possibly unhandled rejection' in rejected resolves
Closes #2889
1 parent 8e86afc commit f73e551

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/resolve.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ function $Resolve( $q, $injector) {
9191
// To complete the overall resolution, we have to wait for the parent
9292
// promise and for the promise for each invokable in our plan.
9393
var resolution = $q.defer(),
94-
result = resolution.promise,
94+
result = silenceUncaughtInPromise(resolution.promise),
9595
promises = result.$$promises = {},
9696
values = extend({}, locals),
9797
wait = 1 + plan.length/3,
9898
merged = false;
99+
100+
silenceUncaughtInPromise(result);
99101

100102
function done() {
101103
// Merge parent values we haven't got yet and publish our own $$values
@@ -175,7 +177,7 @@ function $Resolve( $q, $injector) {
175177
}
176178
}
177179
// Publish promise synchronously; invocations further down in the plan may depend on it.
178-
promises[key] = invocation.promise;
180+
promises[key] = silenceUncaughtInPromise(invocation.promise);
179181
}
180182

181183
return result;

0 commit comments

Comments
 (0)
Please sign in to comment.