Documentation
¶
Overview ¶
Package errctx carries a request-scoped sink that captures the original domain error behind a sanitized transport error.
The transport layer maps a domain error to a client-safe error (hiding SQL errors, stack traces, etc.) before returning it to the caller. That mapping discards the real cause, so a single request-logging interceptor could not otherwise record what actually failed. The sink bridges that gap: the mapper Captures the real error into a per-request sink, and the interceptor reads it back after the handler returns — one log line per request, with the true cause, without every layer logging its own copy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
Capture records err as the real error for the current request when a sink is present. It is a no-op if no sink was installed, so callers need not know whether they run inside a request.
Types ¶
This section is empty.