Compare commits

...

2 Commits

Author SHA1 Message Date
LukeParkerDev
cc37e6da96 fix(server): serialize error stacks in logs 2026-03-23 09:09:38 +10:00
LukeParkerDev
d54b70d18a fix(server): log named error details 2026-03-23 08:57:12 +10:00

View File

@@ -56,8 +56,14 @@ export namespace Server {
const app = new Hono()
return app
.onError((err, c) => {
const msg = err instanceof Error ? err.message : String(err)
const stack = err instanceof Error ? err.stack : undefined
const named = err instanceof NamedError ? err.toObject() : undefined
log.error("failed", {
error: err,
message: msg,
stack: stack ? JSON.stringify(stack) : undefined,
named,
})
if (err instanceof NamedError) {
let status: ContentfulStatusCode