errorstack

package
v0.0.0-...-d283dcf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

func Origin(err error) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL