Open K4leri opened 1 week ago
throw new NotFoundError()
in transform gives
aot: true
aot: false
The issue seems to be that Typobox wraps the NotFoundError
in a TransformDecodeError
, so error.status
is not picked up by app.handleError
.
I took a stab at unwrapping the error in PR #885
What version of Elysia is running?
"elysia": "^1.1.22"
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
What is the expected behavior?
The expected behavior is that when a validation process throws an error, the correct HTTP status code corresponding to that error should be returned in
.onError
.In this case, when a NotFoundError is thrown, the expected behavior is that a 404 HTTP status code should be returned, not a 422 status code.
What do you see instead?
Thrown errors during
t.transform
gives always 422 status code in.onError
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?no