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

This commit is contained in:
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

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,
})
})