From 0a8b943d106a8bd49e22796a3b7f1c0597993692 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sun, 20 Nov 2022 07:06:53 -0800 Subject: [PATCH] Revert "refactor(router): Remove promise catch and re-reject (#48067)" (#48135) This reverts commit 07c9396824f6270872fce86498113c96a5ce6763. This change caused test failures (both unit and integration). Though the code looks like it should be a no-op update, it's possible it affecting something to do with microtasks, zoneJS, and change detection. More investigation would need to be done into the exact nature of the failures. PR Close #48135 --- packages/router/src/router.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index 1d90f1d55ab..a45e8330bd2 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -1413,7 +1413,11 @@ export class Router { currentRouterState: this.routerState }); - return promise; + // Make sure that the error is propagated even though `processNavigations` catch + // handler does not rethrow + return promise.catch((e: any) => { + return Promise.reject(e); + }); } private setBrowserUrl(url: UrlTree, t: NavigationTransition) {