MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / WithCandidateCode

Function WithCandidateCode

pkg/sql/pgwire/pgerror/pgcode.go:25–31  ·  view source on GitHub ↗

WithCandidateCode decorates the error with a candidate postgres error code. It is called "candidate" because the code is only used by GetPGCode() below conditionally. The code is considered PII-free and is thus reportable.

(err error, code string)

Source from the content-addressed store, hash-verified

23// by GetPGCode() below conditionally.
24// The code is considered PII-free and is thus reportable.
25func WithCandidateCode(err error, code string) error {
26 if err == nil {
27 return nil
28 }
29
30 return &withCandidateCode{cause: err, code: code}
31}
32
33// IsCandidateCode returns true iff the error (not its causes)
34// has a candidate pg error code.

Callers 15

helpWithFunction · 0.92
parse.goFile · 0.92
newDecimalFunction · 0.92
setErrMethod · 0.92
ErrorMethod · 0.92
populateErrorDetailsMethod · 0.92
SetHelpMethod · 0.92
pgdate.goFile · 0.92
ToTimeMethod · 0.92
AddDaysMethod · 0.92
SubDaysMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…