Next.js Discord

Discord Forum

server action error handling - status 400/500 not being caught in try/catch

Answered
British Shorthair posted this in #help-forum
Open in Discord
British ShorthairOP
I have an API fetch as a server action, and I am confused why when the request returns a 500 or 400 status code, it does not get caught in the try/catch catch block? You can't return new Error either.
Answered by B33fb0n3
maybe this helps
View full answer

7 Replies

British ShorthairOP
the joulev.dev site dont work for me
@British Shorthair the joulev.dev site dont work for me
maybe this helps
Answer
@B33fb0n3 maybe this helps
British ShorthairOP
lol thank you 🙂
happy to help 🙂 . Please mark solution
British ShorthairOP
ugh, doesn't entirely work with SSR. server actions are TRASH