handleSubmit: throw errors further if you do not define an onError handler #12134
Unanswered
binarykitchen
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just started using your library. Turns out it is swallowing errors if you do not define an
onError
handler.For example, I have a global error handler attached to window for showing them, and this:
There were some HTTP errors happening while submitting, but not shown at all.
Now I've learnt that you have to add an
onError
handler like this:... and there you pass on further the error to my function for showing it.
That said, I think, if no
onError
handler is defined, I think uncaught errors should be thrown further anyway. Swallowing them under magic hooks can be misleading.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions