(err error)
| 183 | } |
| 184 | |
| 185 | func 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 |
no test coverage detected