Skip to content

Commit

Permalink
return an error that wraps the original error
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon committed Jan 31, 2023
1 parent fbaf768 commit e3143ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func defaultOpts(config *rest.Config, opts Options) (Options, error) {
opts.HTTPClient, err = rest.HTTPClientFor(config)
if err != nil {
logger.Error(err, "Failed to get HTTP client")
return opts, fmt.Errorf("could not create HTTP client from config")
return opts, fmt.Errorf("could not create HTTP client from config: %w", err)
}
}

Expand All @@ -442,7 +442,7 @@ func defaultOpts(config *rest.Config, opts Options) (Options, error) {
opts.Mapper, err = apiutil.NewDiscoveryRESTMapper(config, opts.HTTPClient)
if err != nil {
logger.Error(err, "Failed to get API Group-Resources")
return opts, fmt.Errorf("could not create RESTMapper from config")
return opts, fmt.Errorf("could not create RESTMapper from config: %w", err)
}
}

Expand Down

0 comments on commit e3143ac

Please sign in to comment.