import type { Logger } from "./logger.js"; import { type ResponseResult } from "./runtime-core.js"; import type { CtxSet, RawContext } from "./server.js"; /** How much of a thrown error's own text reaches the log sink. Mirrors `Server`'s option. */ export type ErrorLogDetail = "full" | "message" | "none"; /** * Render a value thrown on the bare lane. Three shapes, in the order the lane means them: * - a bare `Response` is the app answering directly - passed through untouched; * - a thrown `status(...)` is control flow, still plain data: rendered through the same `finalize` * a RETURNED one takes, with the request's `c.set`, so it costs what the return costs; * - anything else is a real fault: logged once, then a bodyless 500 (never the caller's error text). * * `responseSet` and `logError` are injected rather than imported so this file keeps no runtime edge * back to `server.ts` (`responseSet` reaches into the context's set symbol; `logError` closes over the * server's logger). Both run only on the throw path, so the closures cost nothing on the hot lane. */ export declare function renderBareError(err: unknown, ctx: RawContext, finalize: (result: unknown, set: CtxSet, ctx: RawContext) => T, wrapResponse: (response: Response | ResponseResult) => T, responseSet: (ctx: RawContext) => CtxSet, logError: (err: unknown, ctx: RawContext) => void, internalError: () => T): T; /** * Write an unhandled request error to the log. An error's own text can quote the input that produced * it, so how much of it reaches the sink is the app's call (`detail`). The default keeps it: a 500 * with no message and no stack is an incident nobody can diagnose, and the framework already ships * the narrower instrument for the leak - a redacting logger with `valuePatterns`. `"none"` is there * for an untrusted sink. */ export declare function emitRequestErrorLog(logger: Logger, detail: ErrorLogDetail, err: unknown, ctx: RawContext): void; //# sourceMappingURL=bare-error-lane.d.ts.map