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

Function ExampleXError_Unwrap

xerror/xerror_example_test.go:40–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40func ExampleXError_Unwrap() {
41 err1 := New("error").With("level", "high")
42 err2 := err1.Wrap(errors.New("invalid username"))
43
44 err := err2.Unwrap()
45
46 fmt.Println(err.Error())
47
48 // Output:
49 // invalid username
50}
51
52func ExampleXError_StackTrace() {
53 err := New("error")

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…