fix(httpapi): add unknown error references (#28629)

This commit is contained in:
Shoubhit Dash
2026-05-21 15:44:35 +05:30
committed by GitHub
parent ee594ba55b
commit fc08292136
3 changed files with 16 additions and 13 deletions

View File

@@ -26,12 +26,15 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
return Effect.succeed(HttpServerResponse.jsonUnsafe(error.toObject(), { status: 400 }))
}
log.error("failed", { error, cause: Cause.pretty(cause) })
const ref = `err_${crypto.randomUUID().slice(0, 8)}`
log.error("failed", { ref, error, cause: Cause.pretty(cause) })
return Effect.succeed(
HttpServerResponse.jsonUnsafe(
new NamedError.Unknown({
message: "Unexpected server error. Check server logs for details.",
ref,
}).toObject(),
{ status: 500 },
),