I\'m trying to add some error handling to a service, following the Angular guide.
Relevant snippet:
private handleError (error: Response | any) { // I
I had the same issue, I finally found this solution.
.catch(error => { let errMsg: string; const body = JSON.parse(error._body); if (body) { errMsg = body.error } else { errMsg = error.message ? error.message : error.toString(); } console.error(errMsg); return Promise.reject(errMsg); });