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

Function NewCodef

errors/gerror/gerror_api_code.go:25–32  ·  view source on GitHub ↗

NewCodef returns an error that has error code and formats as the given format and args.

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

Source from the content-addressed store, hash-verified

23
24// NewCodef returns an error that has error code and formats as the given format and args.
25func NewCodef(code gcode.Code, format string, args ...any) error {
26 return &Error{
27 stack: callers(),
28 text: format,
29 args: args,
30 code: code,
31 }
32}
33
34// NewCodeSkip creates and returns an error which has error code and is formatted from given text.
35// The parameter `skip` specifies the stack callers skipped amount.

Callers 15

SetMethod · 0.92
InsertBeforeMethod · 0.92
InsertAfterMethod · 0.92
FillMethod · 0.92
NewFunction · 0.92
NewFunction · 0.92
doMergeInsertMethod · 0.92
DoExecMethod · 0.92
UnmarshalValueMethod · 0.92
doMergeInsertMethod · 0.92
UnmarshalValueMethod · 0.92
DoExecMethod · 0.92

Calls 1

callersFunction · 0.85

Tested by 11

UnmarshalValueMethod · 0.74
UnmarshalValueMethod · 0.74
UnmarshalValueMethod · 0.74
UnmarshalValueMethod · 0.74
HandleResponseMethod · 0.74
ExampleNewCodefFunction · 0.74
Test_CodeFunction · 0.74
Benchmark_NewCodefFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…