I have an angular2 service that makes an http request:
return this._http.post('<%= API_URL %>/authentication/social', JSON.stringify(socialLogin), {headers: this._headers})
.map((res: Response) => {
return res.json();
})
.catch((error: any) => {
return Observable.throw(error.json().error || 'Server error');
});
Whenever my server returns a 500, the catch part is hit to handle the error, but my console already shows the error: "POST http://localhost:5000/authentication/social 500 (Internal Server Error)"
The whole point of catching the error and handle it is to avoid this horrible red output in the console, is it possible?
Thanks :)