From e06303a9874438a8a9c018b9190ba44ed19e46a2 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Thu, 6 Oct 2016 14:24:33 -0700 Subject: [PATCH] fix(router): improve error message (#12102) --- modules/@angular/router/src/apply_redirects.ts | 2 +- modules/@angular/router/test/apply_redirects.spec.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/@angular/router/src/apply_redirects.ts b/modules/@angular/router/src/apply_redirects.ts index 3b3257b995..0c95d2cc88 100644 --- a/modules/@angular/router/src/apply_redirects.ts +++ b/modules/@angular/router/src/apply_redirects.ts @@ -98,7 +98,7 @@ class ApplyRedirects { } private noMatchError(e: NoMatch): any { - return new Error(`Cannot match any routes: '${e.segmentGroup}'`); + return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`); } private createUrlTree(rootCandidate: UrlSegmentGroup): UrlTree { diff --git a/modules/@angular/router/test/apply_redirects.spec.ts b/modules/@angular/router/test/apply_redirects.spec.ts index a6ab23c4a4..814e87cd90 100644 --- a/modules/@angular/router/test/apply_redirects.spec.ts +++ b/modules/@angular/router/test/apply_redirects.spec.ts @@ -293,7 +293,7 @@ describe('applyRedirects', () => { (e) => { throw 'Should not reach'; }); }); - it('should load the configuration of a whilecard route', () => { + it('should load the configuration of a wildcard route', () => { const loadedConfig = new LoadedRouterConfig( [{path: '', component: ComponentB}], 'stubInjector', 'stubFactoryResolver'); @@ -353,7 +353,7 @@ describe('applyRedirects', () => { applyRedirects(null, null, tree('b'), config) .subscribe( (_) => { throw 'Should not be reached'; }, - e => { expect(e.message).toEqual('Cannot match any routes: \'b\''); }); + e => { expect(e.message).toEqual('Cannot match any routes. URL Segment: \'b\''); }); }); it('redirect from an empty path should work (nested case)', () => { @@ -483,7 +483,7 @@ describe('applyRedirects', () => { applyRedirects(null, null, tree('a/(d//aux:e)'), config) .subscribe( (_) => { throw 'Should not be reached'; }, - e => { expect(e.message).toEqual('Cannot match any routes: \'a\''); }); + e => { expect(e.message).toEqual('Cannot match any routes. URL Segment: \'a\''); }); }); }); });