From bbababe5900ea8f4c8fccd88238f6fe08a2ceb63 Mon Sep 17 00:00:00 2001 From: Srdjan Milic Date: Sun, 6 Feb 2022 08:49:51 +0100 Subject: [PATCH] refactor(http): deprecated symbol used (#44985) Support for passing an error value to "throwError" method will be removed in v8 of rxjs. More info at https://rxjs.dev/api/index/function/throwError#throwerror PR Close #44985 --- aio/content/examples/http/src/app/config/config.component.ts | 2 +- aio/content/examples/http/src/app/config/config.service.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/aio/content/examples/http/src/app/config/config.component.ts b/aio/content/examples/http/src/app/config/config.component.ts index 8df5dd00b08..ebb85e1ef1c 100644 --- a/aio/content/examples/http/src/app/config/config.component.ts +++ b/aio/content/examples/http/src/app/config/config.component.ts @@ -69,7 +69,7 @@ export class ConfigComponent { } // #enddocregion showConfigResponse makeError() { - this.configService.makeIntentionalError().subscribe(null, error => this.error = error ); + this.configService.makeIntentionalError().subscribe(null, error => this.error = error.message ); } getType(val: any): string { diff --git a/aio/content/examples/http/src/app/config/config.service.ts b/aio/content/examples/http/src/app/config/config.service.ts index bc9bf101f36..c974e129677 100644 --- a/aio/content/examples/http/src/app/config/config.service.ts +++ b/aio/content/examples/http/src/app/config/config.service.ts @@ -82,8 +82,7 @@ export class ConfigService { `Backend returned code ${error.status}, body was: `, error.error); } // Return an observable with a user-facing error message. - return throwError( - 'Something bad happened; please try again later.'); + return throwError(() => new Error('Something bad happened; please try again later.')); } // #enddocregion handleError