@mdline wrote:
Hello,
I wrote my own HttpRequestDispatcher to handle globally errors.
post(url: string, body: any, options?: RequestOptionsArgs): Observable<Response> { return this.http.post(url, body, options).map(this.handleResult) .catch(this.handleError); } private handleError(error: any) { if(error.status === 404){ _this.navCtrl.push(LoginPage); } return Observable.throw('Error occured'); }
But is it the proper way to make Observable.throw(‘Error occured’); in case of 404.
Posts: 1
Participants: 1