We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
data
createError()
node: 22.6.0 bun: 1.1.33
Run example from repo:
h3/examples/errors.ts
Lines 20 to 25 in 7324eee
It's currently not possible to use err.data to pass additional data to client-side.
err.data
#823 (comment)
{ "url": "/devices/lol/", "statusCode": 500, "statusMessage": "", "message": "Fatal error", "stack": [ "at createError (./node_modules/h3/dist/index.mjs:78:15)", "at badParamError (./.nitro/dev/index.mjs:934:9)", "at Object.handler (./.nitro/dev/index.mjs:992:11)", "at ./node_modules/h3/dist/index.mjs:1906:43", "at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", "at async Object.handler (./node_modules/h3/dist/index.mjs:1978:19)", "at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:2270:7)" ] }
The text was updated successfully, but these errors were encountered:
@ijkml , according to h3 docs, it is recommended to throw errors instead of returning them using createError utility. You may check and try with it (https://h3.unjs.io/guide/event-handler#responses-types).
createError
Sorry, something went wrong.
No branches or pull requests
Environment
node: 22.6.0
bun: 1.1.33
Reproduction
Run example from repo:
h3/examples/errors.ts
Lines 20 to 25 in 7324eee
(log below)
Describe the bug
It's currently not possible to use
err.data
to pass additional data to client-side.Additional context
#823 (comment)
Logs
The text was updated successfully, but these errors were encountered: