Replies: 1 comment
-
Server Actions always return status HTTP 200 OK, and it's not customizable. I think that allowing users to create custom errors is good enough, since HTTP statuses are not used by underlying React Actions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I like how the error handling is set up: https://next-safe-action.dev/docs/safe-action-client/custom-server-error-handling
But I think it would be nice if the library also exposed something like
TRPCError
where we can throw things like unauthorized, 400, etc in a standard formatI saw here: #88, an example with
class ActionError extends Error {}
. Would be nice if it was integrated with the library automaticallyBeta Was this translation helpful? Give feedback.
All reactions