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

Method Error

xerror/xerror.go:82–93  ·  view source on GitHub ↗

Error implements standard error interface.

()

Source from the content-addressed store, hash-verified

80
81// Error implements standard error interface.
82func (e *XError) Error() string {
83 msg := e.message
84 cause := e.cause
85
86 if cause == nil {
87 return msg
88 }
89
90 msg = fmt.Sprintf("%s: %v", msg, cause.Error())
91
92 return msg
93}
94
95// Format returns:
96// - %v, %s, %q: formatted message

Callers 15

FormatMethod · 0.95
TestRandUniqueIntSliceFunction · 0.45
ExampleCatchFunction · 0.45
ExamplePromise_CatchFunction · 0.45
TestRejectFunction · 0.45
TestCatchFunction · 0.45
TestPromise_CatchFunction · 0.45
TestOrElseTriggerFunction · 0.45
ExampleNewFunction · 0.45
ExampleWrapFunction · 0.45
ExampleXError_WrapFunction · 0.45
ExampleXError_UnwrapFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestRandUniqueIntSliceFunction · 0.36
ExampleCatchFunction · 0.36
ExamplePromise_CatchFunction · 0.36
TestRejectFunction · 0.36
TestCatchFunction · 0.36
TestPromise_CatchFunction · 0.36
TestOrElseTriggerFunction · 0.36
ExampleNewFunction · 0.36
ExampleWrapFunction · 0.36
ExampleXError_WrapFunction · 0.36
ExampleXError_UnwrapFunction · 0.36
ExampleTryUnwrapFunction · 0.36