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

Function NewCodeSkipf

errors/gerror/gerror_api_code.go:46–53  ·  view source on GitHub ↗

NewCodeSkipf returns an error that has error code and formats as the given format and args. The parameter `skip` specifies the stack callers skipped amount.

(code gcode.Code, skip int, format string, args ...any)

Source from the content-addressed store, hash-verified

44// NewCodeSkipf returns an error that has error code and formats as the given format and args.
45// The parameter `skip` specifies the stack callers skipped amount.
46func NewCodeSkipf(code gcode.Code, skip int, format string, args ...any) error {
47 return &Error{
48 stack: callers(skip),
49 text: format,
50 args: args,
51 code: code,
52 }
53}
54
55// WrapCode wraps error with code and text.
56// It returns nil if given err is nil.

Callers 8

Test_CodeFunction · 0.92
Benchmark_NewCodeSkipfFunction · 0.92
niceCallFuncFunction · 0.92
MapToMapsMethod · 0.92
StructsMethod · 0.92
MapToMapMethod · 0.92
StructMethod · 0.92

Calls 1

callersFunction · 0.85

Tested by 2

Test_CodeFunction · 0.74
Benchmark_NewCodeSkipfFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…