`message` field in `createError` not included in response
siranweb opened this issue · comments
Environment
node: 20.11.1
h3: 1.11.1
Reproduction
https://stackblitz.com/edit/github-d9z5tl-zkmmw7?file=app.ts
Describe the bug
Regarding docs, I expect to see message
field in response when it passed to createError
. Not sure, is it actually a bug or a docs issue
Additional context
I checked error.ts. Seems like message
field insn't being used in response at all. Maybe it was expected to work like status
/statusCode
, when one of fields appears in response as statusCode
Logs
No response
Hi dear @siranweb. You should use data
field if want to transfer some data into client-side. message won't be transferred. (docs is also updated with notice)