useQuery never enters Error state
When an error is thrown within the query the query stays in isLoading state.
Within the query we throw expected errors. When a resource isn't found (ie the id doesn't exist in the database).
We are using svelte.
What do we need to do to get the useQuery to get into the error state?
ššš
5 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
For more context.
within my svelte file <script> tag
and then accessing the results of the query
within the getTournamentToRun function
the example found here
https://docs.convex.dev/functions/error-handling/application-errors
I already use elsewhere in my app.
But there's no example of how to properly handle the errors from a useQuery
Application Errors | Convex Developer Hub
If you have expected ways your functions might fail, you can either return
and we are using "useQuery" according to the example found here
https://github.com/get-convex/convex-svelte/tree/main?tab=readme-ov-file
GitHub
GitHub - get-convex/convex-svelte
Contribute to get-convex/convex-svelte development by creating an account on GitHub.
might be a good thing to bring into the #sveltekit forum, where the eyes on it are all pretty invested into svelte + convex