MCPcopy Create free account
hub / github.com/chain/txvm / WithDetail

Function WithDetail

errors/errors.go:86–96  ·  view source on GitHub ↗

WithDetail returns a new error that wraps err as a chain error messsage containing text as its additional context. Function Detail will return the given text when called on the new error value.

(err error, text string)

Source from the content-addressed store, hash-verified

84// Function Detail will return the given text
85// when called on the new error value.
86func WithDetail(err error, text string) error {
87 if err == nil {
88 return nil
89 }
90 if text == "" {
91 return err
92 }
93 e1 := wrap(err, text, 1).(wrapperError)
94 e1.detail = append(e1.detail, text)
95 return e1
96}
97
98// WithDetailf is like WithDetail, except it formats
99// the detail message as in fmt.Printf.

Callers 2

BlockSigFunction · 0.92
TestDetailFunction · 0.85

Calls 1

wrapFunction · 0.85

Tested by 1

TestDetailFunction · 0.68