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

Function FullError

pkg/sql/pgwire/pgerror/errors.go:33–45  ·  view source on GitHub ↗

FullError can be used when the hint and/or detail are to be tested.

(err error)

Source from the content-addressed store, hash-verified

31
32// FullError can be used when the hint and/or detail are to be tested.
33func FullError(err error) string {
34 var errString string
35 if err == nil {
36 panic("FullError should not be called with nil input")
37 }
38 if pqErr := (*pq.Error)(nil); errors.As(err, &pqErr) {
39 errString = formatMsgHintDetail("pq", pqErr.Message, pqErr.Hint, pqErr.Detail)
40 } else {
41 pg := Flatten(err)
42 errString = formatMsgHintDetail(pg.Severity, err.Error(), pg.Hint, pg.Detail)
43 }
44 return errString
45}
46
47func formatMsgHintDetail(prefix, msg, hint, detail string) string {
48 var b strings.Builder

Callers 1

IsSQLRetryableErrorFunction · 0.85

Calls 4

formatMsgHintDetailFunction · 0.85
FlattenFunction · 0.85
AsMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…