tweak: include stack trace in server error responses (#3134)

pull/3149/head
Tommy D. Rossi 2025-10-13 21:10:35 +02:00 committed by GitHub
parent f81c469f17
commit 066e4f064d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -71,7 +71,8 @@ export namespace Server {
status: 400,
})
}
return c.json(new NamedError.Unknown({ message: err.toString() }).toObject(), {
const message = err instanceof Error && err.stack ? err.stack : err.toString()
return c.json(new NamedError.Unknown({ message }).toObject(), {
status: 400,
})
})