amit
amit

Reputation: 2331

Equivalent do() methods for errors in RxJS

What is the equivalent to the do() method for error handling. I.e perform an operation such as logging the error but don't "catch" it, so the original error will reach to the subscribe() method.

Upvotes: 1

Views: 9

Answers (1)

amit
amit

Reputation: 2331

ended up doing this:

.catch((err : any, caught : Observable<any>)  => {
           console.error(err.status + ' ' + err.text());
           return Observable.throw(err);
})

Upvotes: 1

Related Questions