mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08: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:
committed by
Alex Rickabaugh
parent
4c778cdb28
commit
bbababe590
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user