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

Method With

xerror/xerror.go:128–131  ·  view source on GitHub ↗

With adds key and value related to the error object

(key string, value any)

Source from the content-addressed store, hash-verified

126
127// With adds key and value related to the error object
128func (e *XError) With(key string, value any) *XError {
129 e.values[key] = value
130 return e
131}
132
133// Is checks if target error is XError and Error.id of two errors are matched.
134func (e *XError) Is(target error) bool {

Callers 9

ExampleXError_WrapFunction · 0.80
ExampleXError_UnwrapFunction · 0.80
ExampleXError_WithFunction · 0.80
ExampleXError_ValuesFunction · 0.80
ExampleXError_InfoFunction · 0.80
TestXError_WrapFunction · 0.80
TestXError_UnwrapFunction · 0.80
TestXError_InfoFunction · 0.80

Calls

no outgoing calls

Tested by 9

ExampleXError_WrapFunction · 0.64
ExampleXError_UnwrapFunction · 0.64
ExampleXError_WithFunction · 0.64
ExampleXError_ValuesFunction · 0.64
ExampleXError_InfoFunction · 0.64
TestXError_WrapFunction · 0.64
TestXError_UnwrapFunction · 0.64
TestXError_InfoFunction · 0.64