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) {
()
| 305 | // // Can check for original error |
| 306 | // } |
| 307 | func (e *Error) Unwrap() error { |
| 308 | return e.Cause |
| 309 | } |
| 310 | |
| 311 | // NewError creates a new structured error. |
| 312 | // |
no outgoing calls