mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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:
parent
4c778cdb28
commit
bbababe590
2 changed files with 2 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue