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

Function handleError

storage/s3/storage.go:185–196  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

183}
184
185func handleError(err error) (*storage.ObjectReader, error) {
186 var rerr *awsHttp.ResponseError
187 if !errors.As(err, &rerr) {
188 return nil, errctx.Wrap(err)
189 }
190
191 if rerr.Response == nil || rerr.Response.StatusCode < 100 || rerr.Response.StatusCode == http.StatusMovedPermanently {
192 return nil, errctx.Wrap(err)
193 }
194
195 return storage.NewObjectError(rerr.Response.StatusCode, err.Error()), nil
196}
197
198// callWithClient is a helper function to call S3 client method with automatic region
199// error handling

Callers 1

GetObjectMethod · 0.70

Calls 3

WrapFunction · 0.92
NewObjectErrorFunction · 0.92
ErrorMethod · 0.65

Tested by

no test coverage detected