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

Function Wrap

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

Wrap wraps an error and adds a pg error code. Only the code is added if the message is empty.

(err error, code pgcode.Code, msg string)

Source from the content-addressed store, hash-verified

30// Wrap wraps an error and adds a pg error code. Only the code
31// is added if the message is empty.
32func Wrap(err error, code pgcode.Code, msg string) error {
33 if msg == "" {
34 return WithCandidateCode(err, code)
35 }
36 return WrapWithDepthf(1, err, code, "%s", msg)
37}

Callers 4

parseEWKTFunction · 0.92
parseGeoHashFunction · 0.92
consumeNumMethod · 0.92
consumeIntMethod · 0.92

Calls 2

WithCandidateCodeFunction · 0.85
WrapWithDepthfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…