diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-10-28 13:16:42 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-10-30 05:34:04 -0400 |
commit | 831d7fb0d7ee007fc04b1b0ff24b77c7d5635f5e (patch) | |
tree | 2888d983aea9538c421bcb2cbfce818a1904dd7a /cmd/podman/generate | |
parent | 228396a99dc88fc828f23d4072a46ca8de90282f (diff) | |
download | podman-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/generate')
-rw-r--r-- | cmd/podman/generate/kube.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/podman/generate/kube.go b/cmd/podman/generate/kube.go index 4935fc60c..87f7501e3 100644 --- a/cmd/podman/generate/kube.go +++ b/cmd/podman/generate/kube.go @@ -55,7 +55,7 @@ func kube(cmd *cobra.Command, args []string) error { } if cmd.Flags().Changed("filename") { if _, err := os.Stat(kubeFile); err == nil { - return errors.Errorf("cannot write to %q", kubeFile) + return errors.Errorf("cannot write to %q; file exists", kubeFile) } if err := ioutil.WriteFile(kubeFile, content, 0644); err != nil { return errors.Wrapf(err, "cannot write to %q", kubeFile) |