Errors thrown in a server action come back as a digest string in production and I cannot see what happened
In development I get a real stack trace, in production the client just gets a generic message and a digest number, so I am debugging by guesswork. There is a mix of expected failures like a duplicate email and genuinely unexpected ones like the database being unreachable, and right now both look identical to the user. What is the pattern people settled on for the two cases.
@adjunct_life · last mo.
Partly disagreeing with returning errors as values everywhere. Once every action returns a union of success and six kinds of failure, every call site grows a switch, and in a large app that becomes more code than the features. I keep returned errors strictly for field level validation that the form renders, and let everything else throw into a boundary with a sensible fallback. Fewer paths, less ceremony, and the unexpected cases end up somewhere a human actually looks.
Reply
Report