Documentation
¶
Overview ¶
Package errorstack extracts stack traces embedded in errors, shared by tracing and logging so both report the same error origin stack format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Origin ¶
Origin extracts the deepest stack trace embedded in the unwrap chain of err and formats it like a Go stack trace with the innermost (error creation) frame first. It returns "" when no error in the chain carries a stack trace.
A stack captured during package initialization is treated as no stack at all: it belongs to a package-level sentinel's construction and points at runtime.doInit, never at the failure site. Skipping it lets the deepest run-time stack in the chain win, typically the site that wrapped the sentinel.
Types ¶
This section is empty.