useMutation Unhandled Runtime Error using axios #3575
-
I just want to ask how do I handle POST request error using axios. When I try to add So I have this following API call
then I used it like this
When clicked, no error is being logged and NextJS reports a Unhandled Runtime Error. Do I have to wrap a try..catch.. in my I also created a sandbox link https://codesandbox.io/s/currying-frost-r2wlx3 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
the sandbox looks fine for me. on click, I see 3 log messages: two are from your |
Beta Was this translation helpful? Give feedback.
the sandbox looks fine for me. on click, I see 3 log messages:
two are from your
onError
handling, and one is from react-query because we log errors to the console per default via ourlogger
.