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 4dd71c69ab..e41c24f39c 100644 --- a/aio/content/examples/http/src/app/config/config.service.ts +++ b/aio/content/examples/http/src/app/config/config.service.ts @@ -76,15 +76,15 @@ export class ConfigService { console.error('An error occurred:', error.error.message); } else { // The backend returned an unsuccessful response code. - // The response body may contain clues as to what went wrong, + // The response body may contain clues as to what went wrong. console.error( `Backend returned code ${error.status}, ` + `body was: ${error.error}`); } - // return an observable with a user-facing error message + // Return an observable with a user-facing error message. return throwError( 'Something bad happened; please try again later.'); - }; + } // #enddocregion handleError makeIntentionalError() { diff --git a/aio/content/guide/http.md b/aio/content/guide/http.md index 410e0acd40..3605a9d871 100644 --- a/aio/content/guide/http.md +++ b/aio/content/guide/http.md @@ -277,7 +277,7 @@ searchHeroes(term: string): Observable { return this.http.jsonp(heroesUrl, 'callback').pipe( catchError(this.handleError('searchHeroes', [])) // then handle the error ); -}; +} ``` This request passes the `heroesURL` as the first parameter and the callback function name as the second parameter.