Question about onError
I've got a throw inside my loadUserData because I thought onError would catch it, so I guess I've misused onError.
5 Replies
Also, am I able to safely make onMount's callback async?
the only function that can handle errors on all of JS is "window.onerror" and that's on the browser
you can imagine onError as try-catch. If you run a setTimeout in
try
, and the callback throws, would you expect the catch
block to receive it?So I take it onError is less of a "catch-all" within this component, and more of a if literally this component function throws.
From the docs "Registers an error handler method that executes when child scope errors", I had assumed the solid compiler did something to be able to react to errors originating from the component.
Wasn't sure how much "magic" solid is doing vs something like svelte.
the compiler only touches JSX. What you see is what Solid looks like with or without the compiler
Gotcha
So without jsx, solid would run in the browser directly?
Thats pretty neat