1

My catch error method is not catching error if server is down.

let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
return this.http.post(this.PATH + '/signup', details, options)
    .map(res => res.json())
    .catch(res => Observable.throw(res['_body']));
olsn
  • 16,644
  • 6
  • 59
  • 65
Karlis Filipsons
  • 135
  • 1
  • 12
  • You can handle error in the subscribe method: .subscribe(res => this.onResponse(), err => this.onError()) – Ploppy Nov 26 '16 at 16:53
  • Possible duplicate of [Angular2 HTTP - How to understand that the backend server is down](https://stackoverflow.com/questions/35601795/angular2-http-how-to-understand-that-the-backend-server-is-down) – superjos Jun 22 '17 at 10:21

0 Answers0