MCPcopy Index your code
hub / github.com/cockroachdb/errors / WithMessage

Function WithMessage

errutil/message.go:23–31  ·  view source on GitHub ↗

WithMessage annotates err with a new message. If err is nil, WithMessage returns nil. The message is considered safe for reporting and is included in Sentry reports.

(err error, message string)

Source from the content-addressed store, hash-verified

21// The message is considered safe for reporting
22// and is included in Sentry reports.
23func WithMessage(err error, message string) error {
24 if err == nil {
25 return nil
26 }
27 return &withPrefix{
28 cause: err,
29 prefix: redact.Sprint(redact.Safe(message)),
30 }
31}
32
33// WithMessagef annotates err with the format specifier.
34// If err is nil, WithMessagef returns nil.

Callers 3

WithMessageFunction · 0.92
datadriven_test.goFile · 0.92
WrapWithDepthFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…