We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
onError
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.2.2
Darwin 24.1.0 arm64 arm
import Elysia, { t } from "elysia"; new Elysia() .onError(({ code }) => { console.log("[onError]", code); return { error: { code } }; }) .get( "/bug", async ({ cookie }) => { if (!cookie.bug.value) { cookie.bug.value = new Date().toISOString(); } return { value: cookie.bug.value }; }, { cookie: t.Cookie( { bug: t.Optional(t.String()) }, { secrets: crypto.randomUUID(), sign: ["bug"] } ), } ) .get("/crash", async () => { throw new Error("something"); }) .listen(3000);
/bug
Response should be
{"error":{"code":"INVALID_COOKIE_SIGNATURE"}}
Also should log in console:
[onError] INVALID_COOKIE_SIGNATURE
Response does not follow the format defined in onError
"bug" has invalid cookie signature
Also no log.
The onError is not called at all
node_modules
bun.lockb
No response
The text was updated successfully, but these errors were encountered:
Should have been fixed with e34c73c, going to be published under 1.2.7
Sorry, something went wrong.
Published under 1.2.7.
Feel free to reopen tag me or reopen the issue if the problem still happen.
thank you, confirmed fixed
No branches or pull requests
What version of Elysia is running?
1.2.2
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
/bug
/bug
againWhat is the expected behavior?
Response should be
Also should log in console:
What do you see instead?
Response does not follow the format defined in
onError
Also no log.
Additional information
The
onError
is not called at allHave you try removing the
node_modules
andbun.lockb
and try again yet?No response
The text was updated successfully, but these errors were encountered: