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