MCPcopy Index your code
hub / github.com/cockroachdb/errors / WithStack

Function WithStack

withstack_api.go:32–32  ·  view source on GitHub ↗

This file mirrors the WithStack functionality from github.com/pkg/errors. We would prefer to reuse the withStack struct from that package directly (the library recognizes it well) unfortunately github.com/pkg/errors does not enable client code to customize the depth at which the stack trace is captu

(err error)

Source from the content-addressed store, hash-verified

30// - in Sentry reports.
31// - when innermost stack capture, with `errors.GetOneLineSource()`.
32func WithStack(err error) error { return withstack.WithStackDepth(err, 1) }
33
34// WithStackDepth annotates err with a stack trace starting from the
35// given call depth. The value zero identifies the caller

Callers 1

BenchmarkErrorsIsFunction · 0.92

Calls 1

WithStackDepthFunction · 0.92

Tested by 1

BenchmarkErrorsIsFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…