MCPcopy Index your code
hub / github.com/chain/txvm / Wrap

Function Wrap

errors/errors.go:66–71  ·  view source on GitHub ↗

Wrap adds a context message and stack trace to err and returns a new error with the new context. Arguments are handled as in fmt.Print. Use Root to recover the original error wrapped by one or more calls to Wrap. Use Stack to recover the stack trace. Wrap returns nil if err is nil.

(err error, a ...interface{})

Source from the content-addressed store, hash-verified

64// Use Stack to recover the stack trace.
65// Wrap returns nil if err is nil.
66func Wrap(err error, a ...interface{}) error {
67 if err == nil {
68 return nil
69 }
70 return wrap(err, fmt.Sprint(a...), 1)
71}
72
73// Wrapf is like Wrap, but arguments are handled as in fmt.Printf.
74func Wrapf(err error, format string, a ...interface{}) error {

Callers 15

NewChainFunction · 0.92
RecoverMethod · 0.92
CommitAppliedBlockMethod · 0.92
CommitBlockMethod · 0.92
finalizeCommitStateMethod · 0.92
FromBytesMethod · 0.92
BytesMethod · 0.92
ApplyBlockMethod · 0.92
BlockOnlyFunction · 0.92
opOutputFunction · 0.92
opWrapFunction · 0.92
opGetFunction · 0.92

Calls 1

wrapFunction · 0.85

Tested by 8

TestPrintkvStackFunction · 0.74
TestErrorFunction · 0.74
TestWrapFunction · 0.68
TestWrapNilFunction · 0.68
TestWrapMsgFunction · 0.68
TestDetailFunction · 0.68
TestDataFunction · 0.68
TestSubFunction · 0.68