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
This commit is contained in:
Srdjan Milic 2022-02-06 08:49:51 +01:00 committed by Alex Rickabaugh
parent 4c778cdb28
commit bbababe590
2 changed files with 2 additions and 3 deletions

View file

@ -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 {

View file

@ -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