I am not sure how to handle http errors in an angular2 observable. What I have is
getContextAddress() : Observable<string[]> {
return this.http.get(this.patientContextProviderURL)
.map((res:Response) => {
return res.json()
})
.catch((error:any) => Observable.throw(error.json().error || 'Server error'));
}
in valid URL cases, i.e. response of 200, all is well. I am not sure why when I use a bad url, response code of 400, there is no error generate.
How do I handle that case?