Is there a way to map not only the successful response but also the error?
I want to get a modified error in the subscribe function
request.subscribe(
response => {
this.user = response;
},
error => {
this.error = error;
}
);
I already tried this
let request = this.http.put(url, JSON.stringify(user))
.map(
response => response.json(),
error => this.handleError(error) // returns a string
);
but handleError
is never getting executed.
Thanks in advance.