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)
| 42 | // trace is configurable. |
| 43 | // See the doc of `New()` for more details. |
| 44 | func 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. |
no test coverage detected
searching dependent graphs…