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.
This commit is contained in:
arturovt 2026-05-22 20:34:10 +03:00
parent dfbe7a6ecd
commit efec72b355

View file

@ -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();