Skip to content

Do subscriptions catch errors? #687

Answered by hayes
ricardo-valero asked this question in Q&A
Discussion options

You must be logged in to vote

Can you elaborate a little more on this question, or provide an example?

In pothos, a subscription field has 2 callbacks: the subscribe function, and the resolve function, both of these are passed directly to the underlying field in the generated graphql schema, so the details of how errors are handled are not controlled by pothos, but are actually handled by the graphql execution engine you are using.

subscriptions can error in multiple ways, the initial function can throw an error, but it also should return an async iterator, where it can emit an error or rejected promise when the iterator is consumed. In each of these cases though, I would expect the error to be "handled", but the way …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ricardo-valero
Comment options

Answer selected by ricardo-valero
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