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

Method WithCause

pkg/errors/errors.go:429–432  ·  view source on GitHub ↗

WithCause adds an underlying cause error. Wraps another error as the cause of this error, enabling error chaining and unwrapping with errors.Is and errors.As. Parameters: - cause: The underlying error that caused this error Returns the same Error instance with cause added (for method chaining).

(cause error)

Source from the content-addressed store, hash-verified

427//
428// Note: WithCause modifies the error in-place and returns it for chaining.
429func (e *Error) WithCause(cause error) *Error {
430 e.Cause = cause
431 return e
432}
433
434// IsCode checks if an error has a specific error code.
435//

Callers 2

TestError_UnwrapFunction · 0.95
WrapErrorFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestError_UnwrapFunction · 0.76