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

Function WrapWithDepth

errutil/utilities.go:111–120  ·  view source on GitHub ↗

WrapWithDepth is like Wrap except the depth to capture the stack trace is configurable. The the doc of `Wrap()` for more details.

(depth int, err error, msg string)

Source from the content-addressed store, hash-verified

109// trace is configurable.
110// The the doc of `Wrap()` for more details.
111func WrapWithDepth(depth int, err error, msg string) error {
112 if err == nil {
113 return nil
114 }
115 if msg != "" {
116 err = WithMessage(err, msg)
117 }
118 err = withstack.WithStackDepth(err, depth+1)
119 return err
120}
121
122// Wrapf wraps an error with a formatted message prefix. A stack
123// trace is also retained. If the format is empty, no prefix is added,

Callers 3

WrapFunction · 0.92
WrapWithDepthFunction · 0.92
WrapFunction · 0.70

Calls 2

WithStackDepthFunction · 0.92
WithMessageFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…