MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / WrapWithDepthf

Function WrapWithDepthf

pkg/sql/pgwire/pgerror/wrap.go:22–28  ·  view source on GitHub ↗

WrapWithDepthf wraps an error. It also annotates the provided pg code as new candidate code, to be used if the underlying error does not have one already.

(
	depth int, err error, code pgcode.Code, format string, args ...interface{},
)

Source from the content-addressed store, hash-verified

20// pg code as new candidate code, to be used if the underlying
21// error does not have one already.
22func WrapWithDepthf(
23 depth int, err error, code pgcode.Code, format string, args ...interface{},
24) error {
25 err = errors.WrapWithDepthf(1+depth, err, format, args...)
26 err = WithCandidateCode(err, code)
27 return err
28}
29
30// Wrap wraps an error and adds a pg error code. Only the code
31// is added if the message is empty.

Callers 2

WrapfFunction · 0.85
WrapFunction · 0.85

Calls 1

WithCandidateCodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…