mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-20 10:59:59 +00:00
fix(server): log named error details
This commit is contained in:
@@ -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,
|
||||
named,
|
||||
})
|
||||
if (err instanceof NamedError) {
|
||||
let status: ContentfulStatusCode
|
||||
|
||||
Reference in New Issue
Block a user