-
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Oct 30, 2020
Replies: 2 comments
-
Errors are generic in react-query because every promise from a fetch / mutation function can throw with, well, anything literally in javascript, so there is no way to tell. I would just do a custom hook:
or something similar. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
apenab
-
Sometime will return have field message, i will check throw new Error(err.message) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Errors are generic in react-query because every promise from a fetch / mutation function can throw with, well, anything literally in javascript, so there is no way to tell. I would just do a custom hook:
or something similar.