MCPcopy
hub / github.com/gogf/gf / WrapCodeSkip

Function WrapCodeSkip

errors/gerror/gerror_api_code.go:87–97  ·  view source on GitHub ↗

WrapCodeSkip wraps error with code and text. It returns nil if given err is nil. The parameter `skip` specifies the stack callers skipped amount.

(code gcode.Code, skip int, err error, text ...string)

Source from the content-addressed store, hash-verified

85// It returns nil if given err is nil.
86// The parameter `skip` specifies the stack callers skipped amount.
87func WrapCodeSkip(code gcode.Code, skip int, err error, text ...string) error {
88 if err == nil {
89 return nil
90 }
91 return &Error{
92 error: err,
93 stack: callers(skip),
94 text: strings.Join(text, commaSeparatorSpace),
95 code: code,
96 }
97}
98
99// WrapCodeSkipf wraps error with code and text that is formatted with given format and args.
100// It returns nil if given err is nil.

Callers 5

Test_CodeFunction · 0.92
niceCallFuncFunction · 0.92
NextMethod · 0.92

Calls 2

callersFunction · 0.85
JoinMethod · 0.45

Tested by 2

Test_CodeFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…