MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / NewWrappedError

Function NewWrappedError

errctx/wrapped_error.go:18–23  ·  view source on GitHub ↗

NewWrappedError creates a new [WrappedError] with the given error and options. It wraps the provided even if it already is an [WrappedError] and always creates a new context. To avoid double wrapping and reuse existing context, use [Wrap] instead.

(err error, stackSkip int, opts ...Option)

Source from the content-addressed store, hash-verified

16// creates a new context.
17// To avoid double wrapping and reuse existing context, use [Wrap] instead.
18func NewWrappedError(err error, stackSkip int, opts ...Option) *WrappedError {
19 return &WrappedError{
20 error: err,
21 ErrorContext: newErrorContext(stackSkip+1, opts...),
22 }
23}
24
25// Wrap creates a new [WrappedError] with the given error and options.
26// It gets the stack trace from the call site.

Callers 6

newRequestErrorFunction · 0.92
newRequestCanceledErrorFunction · 0.92
newRequestTimeoutErrorFunction · 0.92
newTypeDetectionErrorFunction · 0.92
NewResponseWriteErrorFunction · 0.92
newSanitizeErrorFunction · 0.92

Calls 1

newErrorContextFunction · 0.85

Tested by

no test coverage detected