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

Function NewWithDepth

errutil/utilities.go:44–48  ·  view source on GitHub ↗

NewWithDepth is like New() except the depth to capture the stack trace is configurable. See the doc of `New()` for more details.

(depth int, msg string)

Source from the content-addressed store, hash-verified

42// trace is configurable.
43// See the doc of `New()` for more details.
44func NewWithDepth(depth int, msg string) error {
45 err := error(&leafError{redact.Sprint(redact.Safe(msg))})
46 err = withstack.WithStackDepth(err, 1+depth)
47 return err
48}
49
50// Newf creates an error with a formatted error message.
51// A stack trace is retained.

Callers 3

NewFunction · 0.92
NewWithDepthFunction · 0.92
NewFunction · 0.70

Calls 1

WithStackDepthFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…