diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-07-05 16:10:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 16:10:12 +0000 |
commit | 39fc5d1f4f26f82ed1ca23d97f43924335c4c529 (patch) | |
tree | e0a54c6d0e3a1bc238cb5ef4a9316b55b39217ee /libpod/pod_internal.go | |
parent | 9539a89ee77682ed3f4d1d0be3b950523e2f2439 (diff) | |
parent | 251d91699de4e9aaab53ab6fea262d4b6bdaae8e (diff) | |
download | podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.tar.gz podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.tar.bz2 podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.zip |
Merge pull request #14828 from saschagrunert/errors-libpod
libpod: switch to golang native error wrapping
Diffstat (limited to 'libpod/pod_internal.go')
-rw-r--r-- | libpod/pod_internal.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libpod/pod_internal.go b/libpod/pod_internal.go index 1502bcb06..a86cd6d21 100644 --- a/libpod/pod_internal.go +++ b/libpod/pod_internal.go @@ -9,7 +9,6 @@ import ( "github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/pkg/rootless" "github.com/containers/storage/pkg/stringid" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -39,7 +38,7 @@ func (p *Pod) updatePod() error { // Save pod state to database func (p *Pod) save() error { if err := p.runtime.state.SavePod(p); err != nil { - return errors.Wrapf(err, "error saving pod %s state", p.ID()) + return fmt.Errorf("error saving pod %s state: %w", p.ID(), err) } return nil @@ -61,7 +60,7 @@ func (p *Pod) refresh() error { // Retrieve the pod's lock lock, err := p.runtime.lockManager.AllocateAndRetrieveLock(p.config.LockID) if err != nil { - return errors.Wrapf(err, "error retrieving lock %d for pod %s", p.config.LockID, p.ID()) + return fmt.Errorf("error retrieving lock %d for pod %s: %w", p.config.LockID, p.ID(), err) } p.lock = lock @@ -81,7 +80,7 @@ func (p *Pod) refresh() error { logrus.Debugf("setting pod cgroup to %s", p.state.CgroupPath) } default: - return errors.Wrapf(define.ErrInvalidArg, "unknown cgroups manager %s specified", p.runtime.config.Engine.CgroupManager) + return fmt.Errorf("unknown cgroups manager %s specified: %w", p.runtime.config.Engine.CgroupManager, define.ErrInvalidArg) } } |