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
This commit is contained in:
Bastian 2021-07-05 12:32:20 +02:00 committed by Andrew Kushnir
parent 9ec241926e
commit 50b6aae029
1 changed files with 1 additions and 2 deletions

View File

@ -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(