From 50b6aae0296a89a4079ed0426e27211cdf0f4a1a Mon Sep 17 00:00:00 2001 From: Bastian Date: Mon, 5 Jul 2021 12:32:20 +0200 Subject: [PATCH] docs: fix http example to show actual message in console (#42773) Previously, the error message in the console would print `[object Object]` and not the actual error message. With this change, the error message is printed in the console. PR Close #42773 --- aio/content/examples/http/src/app/config/config.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 4905fd4d58..bc9bf101f3 100644 --- a/aio/content/examples/http/src/app/config/config.service.ts +++ b/aio/content/examples/http/src/app/config/config.service.ts @@ -79,8 +79,7 @@ export class ConfigService { // The backend returned an unsuccessful response code. // The response body may contain clues as to what went wrong. console.error( - `Backend returned code ${error.status}, ` + - `body was: ${error.error}`); + `Backend returned code ${error.status}, body was: `, error.error); } // Return an observable with a user-facing error message. return throwError(