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?

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to