Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
emitError(id: number = 1, url: string = 'testUrl.com/test', error: string = 'Test Error') {
this.eventsSubject.next(new NavigationError(this.id, url, error));
}
private dispatchRouterError(event: NavigationError): void {
this.dispatchRouterAction(
new RouterError(
this._routerState!,
this._storeState,
new NavigationError(event.id, event.url, `${event}`),
this._trigger
)
);
}
(e: any) => {
if (isNavigationCancelingError(e)) {
router.navigated = true;
router.resetStateAndUrl(storedState, storedUrl, rawUrl);
(router.events as Subject)
.next(new NavigationCancel(id, router.serializeUrl(url), e.message));
resolvePromise(false);
} else {
router.resetStateAndUrl(storedState, storedUrl, rawUrl);
(router.events as Subject)
.next(new NavigationError(id, router.serializeUrl(url), e));
try {
resolvePromise(router.errorHandler(e));
} catch (ee) {
rejectPromise(ee);
}
}
});
private dispatchRouterError(event: NavigationError): void {
this.dispatchRouterAction(ROUTER_ERROR, {
storeState: this.storeState,
event: new NavigationError(event.id, event.url, `${event}`),
});
}