MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / Unwrap

Method Unwrap

pkg/errors/errors.go:307–309  ·  view source on GitHub ↗

Unwrap returns the underlying error. Implements error unwrapping for Go 1.13+ error chains. This allows errors.Is and errors.As to work with wrapped errors. Example: originalErr := someFunc() wrappedErr := errors.NewError(...).WithCause(originalErr) if errors.Is(wrappedErr, originalErr) {

()

Source from the content-addressed store, hash-verified

305// // Can check for original error
306// }
307func (e *Error) Unwrap() error {
308 return e.Cause
309}
310
311// NewError creates a new structured error.
312//

Callers 4

TestError_UnwrapFunction · 0.95
Example_errorChainingFunction · 0.45
Example_chainedErrorsFunction · 0.45
TestWrapErrorFunction · 0.45

Calls

no outgoing calls

Tested by 4

TestError_UnwrapFunction · 0.76
Example_errorChainingFunction · 0.36
Example_chainedErrorsFunction · 0.36
TestWrapErrorFunction · 0.36