summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
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 /libpod/container_internal.go
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 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index cafe70b80..0aeaae43d 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -578,10 +578,10 @@ func (c *Container) refresh() error {
if len(c.config.IDMappings.UIDMap) != 0 || len(c.config.IDMappings.GIDMap) != 0 {
info, err := os.Stat(c.runtime.config.Engine.TmpDir)
if err != nil {
- return errors.Wrapf(err, "cannot stat `%s`", c.runtime.config.Engine.TmpDir)
+ return err
}
if err := os.Chmod(c.runtime.config.Engine.TmpDir, info.Mode()|0111); err != nil {
- return errors.Wrapf(err, "cannot chmod `%s`", c.runtime.config.Engine.TmpDir)
+ return err
}
root := filepath.Join(c.runtime.config.Engine.TmpDir, "containers-root", c.ID())
if err := os.MkdirAll(root, 0755); err != nil {