diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-07-08 09:24:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 09:24:25 +0000 |
commit | 6087fb2116aaeae995e8423872ffe637e8be128f (patch) | |
tree | e8bd00a9b325a51a49de02e868f06eec2deeb529 /pkg/bindings/manifests | |
parent | a2bcf833c98cb38eb28dc65a8768963d0b7344fc (diff) | |
parent | a46f798831df06c472b288db7b34de8536a7ea5a (diff) | |
download | podman-6087fb2116aaeae995e8423872ffe637e8be128f.tar.gz podman-6087fb2116aaeae995e8423872ffe637e8be128f.tar.bz2 podman-6087fb2116aaeae995e8423872ffe637e8be128f.zip |
Merge pull request #14839 from saschagrunert/errors-pkg
pkg: switch to golang native error wrapping
Diffstat (limited to 'pkg/bindings/manifests')
-rw-r--r-- | pkg/bindings/manifests/manifests.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go index a68dd5a4e..80153c4b4 100644 --- a/pkg/bindings/manifests/manifests.go +++ b/pkg/bindings/manifests/manifests.go @@ -2,6 +2,8 @@ package manifests import ( "context" + "errors" + "fmt" "io/ioutil" "net/http" "strconv" @@ -15,7 +17,6 @@ import ( "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/errorhandling" jsoniter "github.com/json-iterator/go" - "github.com/pkg/errors" ) // Create creates a manifest for the given name. Optional images to be associated with @@ -219,13 +220,13 @@ func Modify(ctx context.Context, name string, images []string, options *ModifyOp data, err := ioutil.ReadAll(response.Body) if err != nil { - return "", errors.Wrap(err, "unable to process API response") + return "", fmt.Errorf("unable to process API response: %w", err) } if response.IsSuccess() || response.IsRedirection() { var report entities.ManifestModifyReport if err = jsoniter.Unmarshal(data, &report); err != nil { - return "", errors.Wrap(err, "unable to decode API response") + return "", fmt.Errorf("unable to decode API response: %w", err) } err = errorhandling.JoinErrors(report.Errors) @@ -244,7 +245,7 @@ func Modify(ctx context.Context, name string, images []string, options *ModifyOp ResponseCode: response.StatusCode, } if err = jsoniter.Unmarshal(data, &errModel); err != nil { - return "", errors.Wrap(err, "unable to decode API response") + return "", fmt.Errorf("unable to decode API response: %w", err) } return "", &errModel } |