I have this function in Angular 2 which works well on normal circonstances:
private callGetUserService(url: string, id: string): Observable<any> {
return this.authHttp.get(url + id)
.map(res => {
return this.extractData(res);
})
.catch((err) => {
console.log('Error getting account: ' + JSON.stringify(err));
return Observable.of(err);
});
}
When I force a 401 response from the server, the catch(err) is always returning the err.status = 0 and err.ok = false. I am at a total loss, can anyone help?