How to handle errors (exceptions) in a form action action(() => { ... })
?
#543
Unanswered
reivilibre
asked this question in
Q&A
Replies: 2 comments 2 replies
-
I haven't done this with Solid as I work only with SolidStart apps but here are some tips from SolidStart that should be helpful:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Yep, that doesn't work. The recommendation is to return errors rather than throw them: Router>Actions. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I'm using
solid-router
'saction
in a client-side rendered, single-page application, project. I am basing my knowledge off this docs page: https://docs.solidjs.com/solid-router/concepts/actionsI've taken an example from that page, then modified it to dress it up in a
Router
so that we can use it in the playground.see: https://playground.solidjs.com/anonymous/7f376034-8464-4bfb-a9ad-7db94758eb41 (the Playground puts in red squiggles on the import but it actually works fine)
Other than not really having a proper way to handle the error, I'm finding that this swallows the exception (nothing appears in the browser console, execution just stops).
I have tried to follow #387 but, despite it sounding like a way to handle errors was introduced in 0.13.0, I can't figure it out.
Any pointers please? Thanks
Beta Was this translation helpful? Give feedback.
All reactions