Skip to content

Handling errors with ErrorPolicy all in Observable subscriptions? #1582

Discussion options

You must be logged in to vote

In testing, I found that setting errorPolicy: 'all' results in only the next and complete but never the error handler of the Observable subscription being called (and likewise, never the catchError operator in an Observable pipe). So that leads me to conclude that the next handler in the subscription would need to include any error-handling logic after explicitly testing for length in the errors array property of its FetchResult parameter. Alternatively, I suppose one could perform that errors array test in a map or other RxJS operator in a pipe from the Observable subscription, and then decide whether to return partial data or the error using the RxJS throwError operator.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KeithGillette
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant