From efec72b355378dbb8fd4029888e9c6c845b52cec Mon Sep 17 00:00:00 2001 From: arturovt Date: Fri, 22 May 2026 20:34:10 +0300 Subject: [PATCH] fix(router): preserve error names in minified bundles `NoMatch` and `AbsoluteRedirect` are thrown from asynchronous contexts, which means error tracking tools often report only the minified constructor name instead of the original class name (for example Rollbar showing just `"t"` as the error type). This change sets an explicit `name` property on both classes so their readable names are preserved at runtime, even after minification. --- packages/router/src/apply_redirects.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/router/src/apply_redirects.ts b/packages/router/src/apply_redirects.ts index 6741d5f3f6d..cfe5a68ce05 100644 --- a/packages/router/src/apply_redirects.ts +++ b/packages/router/src/apply_redirects.ts @@ -18,6 +18,8 @@ import {wrapIntoObservable} from './utils/collection'; import {firstValueFrom} from './utils/first_value_from'; export class NoMatch extends Error { + override readonly name = 'NoMatch'; + public segmentGroup: UrlSegmentGroup | null; constructor(segmentGroup?: UrlSegmentGroup) { @@ -32,6 +34,8 @@ export class NoMatch extends Error { } export class AbsoluteRedirect extends Error { + override readonly name = 'AbsoluteRedirect'; + constructor(public urlTree: UrlTree) { super();