How to throw errors in `createRouteAction()` and `createServerAction$()`?

Am I supposed to throw new Error(), return an error Response, or...?
3 Replies
pilcrow
pilcrowOP3y ago
Ah, looks like I'm supposed to throw ServerError Not sure why that didn't work before
Jasmin
Jasmin3y ago
Everything you throw inside these functions will be accessible in the .error property :) https://start.solidjs.com/api/createRouteAction#handle-errors
SolidStart Beta Docuentation
SolidStart Beta Documentation
Early release documentation and resources for SolidStart Beta
Thomas
Thomas3y ago
also for createRouteAction ?

Did you find this page helpful?