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

Interface Formatter

errbase/formatter.go:28–48  ·  view source on GitHub ↗

A Formatter formats error messages. NB: Consider implementing SafeFormatter instead. This will ensure that error displays can distinguish bits that are PII-safe.

Source from the content-addressed store, hash-verified

26// NB: Consider implementing SafeFormatter instead. This will ensure
27// that error displays can distinguish bits that are PII-safe.
28type Formatter interface {
29 error
30
31 // FormatError prints the receiver's first error.
32 // The return value decides what happens in the case
33 // FormatError() is used to produce a "short" message,
34 // eg. when it is used to implement Error():
35 //
36 // - if it returns nil, then the short message
37 // contains no more than that produced for this error,
38 // even if the error has a further causal chain.
39 //
40 // - if it returns non-nil, then the short message
41 // contains the value printed by this error,
42 // followed by that of its causal chain.
43 // (e.g. thiserror: itscause: furthercause)
44 //
45 // Note that all the causal chain is reported in verbose reports in
46 // any case.
47 FormatError(p Printer) (next error)
48}
49
50// SafeFormatter is implemented by error leaf or wrapper types that want
51// to separate safe and non-safe information when printed out.

Callers 1

formatRecursiveMethod · 0.65

Implementers 15

werrFmtcontexttags/contexttags_test.go
werrFmtbarriers/barriers_test.go
werrFmtmarkers/markers_test.go
werrFmtdomains/domains_test.go
werrFmtissuelink/issuelink_test.go
werrFmtsecondary/secondary_test.go
werrFmterrutil/message_test.go
werrFmtassert/assert_test.go
werrFmthintdetail/hintdetail_test.go
withDetailhintdetail/with_detail.go
withHinthintdetail/with_hint.go
errFmtfmttests/format_error_test.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…