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 77 */
88
99import { DOCUMENT } from '@angular/common' ;
10- import { HttpClient } from '@angular/common/http' ;
10+ import { HttpClient , HttpErrorResponse } from '@angular/common/http' ;
1111import {
1212 Inject ,
1313 Injectable ,
@@ -353,12 +353,12 @@ export class MatIconRegistry {
353353 . filter ( iconSetConfig => ! iconSetConfig . svgElement )
354354 . map ( iconSetConfig => {
355355 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 ) ;
358358
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 } ` ) ;
362362 return observableOf ( null ) ;
363363 } )
364364 ) ;
Original file line number Diff line number Diff line change @@ -428,9 +428,9 @@ describe('MatIcon', () => {
428428 } ) ) ;
429429
430430 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.
432432 // Jasmine will tear the spy down at the end of the test.
433- spyOn ( console , 'warn ' ) ;
433+ spyOn ( console , 'error ' ) ;
434434
435435 expect ( ( ) => {
436436 iconRegistry . addSvgIconLiteral ( 'circle' , '<svg><circle></svg>' ) ;
You can’t perform that action at this time.
0 commit comments