Replies: 1 comment
-
Fastify, thanks to #4554 already is handling that in a standardized way across its errors. Lines 135 to 139 in ec17333 Which is in fact the validation step, that you're making an example of. I'll create an issue for that |
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
-
let's say we have this sample code.
in case of validation error, the response body would be like this:
but in case of throwing my custom error, the response body would be like this:
as you can see,
code
key is not available in framework level errors.this behavior is already confused our front-end developers and i'm kinda agree with them.
what's is your suggestion? I think we could add
code
key on every framework level errorsBeta Was this translation helpful? Give feedback.
All reactions