summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-10-28 13:16:42 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-10-30 05:34:04 -0400
commit831d7fb0d7ee007fc04b1b0ff24b77c7d5635f5e (patch)
tree2888d983aea9538c421bcb2cbfce818a1904dd7a /cmd/podman/images
parent228396a99dc88fc828f23d4072a46ca8de90282f (diff)
downloadpodman-831d7fb0d7ee007fc04b1b0ff24b77c7d5635f5e.tar.gz
podman-831d7fb0d7ee007fc04b1b0ff24b77c7d5635f5e.tar.bz2
podman-831d7fb0d7ee007fc04b1b0ff24b77c7d5635f5e.zip
Stop excessive wrapping of errors
Most of the builtin golang functions like os.Stat and os.Open report errors including the file system object path. We should not wrap these errors and put the file path in a second time, causing stuttering of errors when they get presented to the user. This patch tries to cleanup a bunch of these errors. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/pull.go3
-rw-r--r--cmd/podman/images/push.go3
-rw-r--r--cmd/podman/images/search.go2
3 files changed, 3 insertions, 5 deletions
diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go
index 35ef80f3c..ab3b0a197 100644
--- a/cmd/podman/images/pull.go
+++ b/cmd/podman/images/pull.go
@@ -9,7 +9,6 @@ import (
"github.com/containers/podman/v2/cmd/podman/registry"
"github.com/containers/podman/v2/pkg/domain/entities"
"github.com/containers/podman/v2/pkg/util"
- "github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
@@ -104,7 +103,7 @@ func imagePull(cmd *cobra.Command, args []string) error {
}
if pullOptions.Authfile != "" {
if _, err := os.Stat(pullOptions.Authfile); err != nil {
- return errors.Wrapf(err, "error getting authfile %s", pullOptions.Authfile)
+ return err
}
}
diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go
index 718bd4e8c..dd45a790f 100644
--- a/cmd/podman/images/push.go
+++ b/cmd/podman/images/push.go
@@ -8,7 +8,6 @@ import (
"github.com/containers/podman/v2/cmd/podman/registry"
"github.com/containers/podman/v2/pkg/domain/entities"
"github.com/containers/podman/v2/pkg/util"
- "github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
@@ -110,7 +109,7 @@ func imagePush(cmd *cobra.Command, args []string) error {
if pushOptions.Authfile != "" {
if _, err := os.Stat(pushOptions.Authfile); err != nil {
- return errors.Wrapf(err, "error getting authfile %s", pushOptions.Authfile)
+ return err
}
}
diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go
index b1a1442a6..29f5558cf 100644
--- a/cmd/podman/images/search.go
+++ b/cmd/podman/images/search.go
@@ -116,7 +116,7 @@ func imageSearch(cmd *cobra.Command, args []string) error {
if searchOptions.Authfile != "" {
if _, err := os.Stat(searchOptions.Authfile); err != nil {
- return errors.Wrapf(err, "error getting authfile %s", searchOptions.Authfile)
+ return err
}
}