MCPcopy Index your code
hub / github.com/gogf/gf / ExampleWrapCodef

Function ExampleWrapCodef

errors/gerror/gerror_z_example_test.go:48–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48func ExampleWrapCodef() {
49 err1 := errors.New("permission denied")
50 err2 := gerror.WrapCodef(gcode.New(10000, "", nil), err1, "It's %s", "Custom Error")
51 fmt.Println(err2.Error())
52 fmt.Println(gerror.Code(err2).Code())
53
54 // Output:
55 // It's Custom Error: permission denied
56 // 10000
57}
58
59func ExampleEqual() {
60 err1 := errors.New("permission denied")

Callers

nothing calls this directly

Calls 6

WrapCodefFunction · 0.92
NewFunction · 0.92
CodeFunction · 0.92
NewMethod · 0.65
ErrorMethod · 0.65
CodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…