Skip to content

continue processing on error #7293

Answered by voliva
tomdavidson asked this question in Q&A
Discussion options

You must be logged in to vote

There's no way :) emitting an error closes all the subscriptions, by design.

Any operator you add after can't change this behaviour, they can only react after the subscriptions are closed. catchError lets you return a new observable that should be used after the error has happened, onErrorResumeNextWith lets you define a list of observables to be used as they keep erroring (like a concatWith but for errors), retry (and variants) let you re-subscribe to the observable that has just errored (But usually will begin back from the start)

How to work around that depends exactly on the use case. From your example, you could easily change it to just

const readNDJSONLines = (filePath: string): Obs…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tomdavidson
Comment options

Answer selected by tomdavidson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants