File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
import { DOCUMENT } from '@angular/common' ;
10
- import { HttpClient } from '@angular/common/http' ;
10
+ import { HttpClient , HttpErrorResponse } from '@angular/common/http' ;
11
11
import {
12
12
Inject ,
13
13
Injectable ,
@@ -353,12 +353,12 @@ export class MatIconRegistry {
353
353
. filter ( iconSetConfig => ! iconSetConfig . svgElement )
354
354
. map ( iconSetConfig => {
355
355
return this . _loadSvgIconSetFromConfig ( iconSetConfig ) . pipe (
356
- catchError ( ( err : any ) : Observable < SVGElement | null > => {
357
- let url = this . _sanitizer . sanitize ( SecurityContext . RESOURCE_URL , iconSetConfig . url ) ;
356
+ catchError ( ( err : HttpErrorResponse ) : Observable < SVGElement | null > => {
357
+ const url = this . _sanitizer . sanitize ( SecurityContext . RESOURCE_URL , iconSetConfig . url ) ;
358
358
359
- // Swallow errors fetching individual URLs so the combined Observable won't
360
- // necessarily fail.
361
- console . log ( `Loading icon set URL: ${ url } failed: ${ err } ` ) ;
359
+ // Swallow errors fetching individual URLs so the
360
+ // combined Observable won't necessarily fail.
361
+ console . error ( `Loading icon set URL: ${ url } failed: ${ err . message } ` ) ;
362
362
return observableOf ( null ) ;
363
363
} )
364
364
) ;
Original file line number Diff line number Diff line change @@ -428,9 +428,9 @@ describe('MatIcon', () => {
428
428
} ) ) ;
429
429
430
430
it ( 'should throw an error when using untrusted HTML' , ( ) => {
431
- // Stub out console.warn so we don't pollute our logs with Angular's warnings.
431
+ // Stub out console.error so we don't pollute our logs with Angular's warnings.
432
432
// Jasmine will tear the spy down at the end of the test.
433
- spyOn ( console , 'warn ' ) ;
433
+ spyOn ( console , 'error ' ) ;
434
434
435
435
expect ( ( ) => {
436
436
iconRegistry . addSvgIconLiteral ( 'circle' , '<svg><circle></svg>' ) ;
You can’t perform that action at this time.
0 commit comments