hasanaktasTRH
Convex Community2y ago
2 replies
hasanaktasTR

Catching thrown errors from queries

I reviewed the documents and posts in the support channel, but I did not get the answer I wanted.

This client blows up the entire application when I return a throw error from a query. Error bound has been suggested, but what I want is not to kill a component or the entire tree, but just print the error message in toast. I don't want to break the UI. For example, we can catch an error related to onError in the config we give to the provider with the Tanstack query.

It is somewhat easy to log the error message with try catch for mutations, but I could not find a way for queries.


How can I achieve this?

I showed the sample model in the picture.
image.png
Was this page helpful?