MCPcopy
hub / github.com/duke-git/lancet / ExampleXError_Wrap

Function ExampleXError_Wrap

xerror/xerror_example_test.go:30–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30func ExampleXError_Wrap() {
31 err1 := New("error").With("level", "high")
32 err2 := err1.Wrap(errors.New("invalid username"))
33
34 fmt.Println(err2.Error())
35
36 // Output:
37 // error: invalid username
38}
39
40func ExampleXError_Unwrap() {
41 err1 := New("error").With("level", "high")

Callers

nothing calls this directly

Calls 5

WithMethod · 0.80
WrapMethod · 0.80
NewMethod · 0.80
NewFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…