From 2c63b8439bbdc09203ea394ad2cf9352830861f0 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sat, 10 Sep 2022 07:40:39 -0400 Subject: Fix stutters Podman adds an Error: to every error message. So starting an error message with "error" ends up being reported to the user as Error: error ... This patch removes the stutter. Also ioutil.ReadFile errors report the Path, so wrapping the err message with the path causes a stutter. Signed-off-by: Daniel J Walsh --- libpod/runtime_cstorage.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libpod/runtime_cstorage.go') diff --git a/libpod/runtime_cstorage.go b/libpod/runtime_cstorage.go index 047375628..372434b49 100644 --- a/libpod/runtime_cstorage.go +++ b/libpod/runtime_cstorage.go @@ -39,7 +39,7 @@ func (r *Runtime) ListStorageContainers() ([]*StorageContainer, error) { // Look up if container is in state hasCtr, err := r.state.HasContainer(ctr.ID) if err != nil { - return nil, fmt.Errorf("error looking up container %s in state: %w", ctr.ID, err) + return nil, fmt.Errorf("looking up container %s in state: %w", ctr.ID, err) } storageCtr.PresentInLibpod = hasCtr @@ -64,7 +64,7 @@ func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { if errors.Is(err, storage.ErrLayerUnknown) { return fmt.Errorf("no container with ID or name %q found: %w", idOrName, define.ErrNoSuchCtr) } - return fmt.Errorf("error looking up container %q: %w", idOrName, err) + return fmt.Errorf("looking up container %q: %w", idOrName, err) } // Lookup returns an ID but it's not guaranteed to be a container ID. @@ -74,7 +74,7 @@ func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { if errors.Is(err, storage.ErrContainerUnknown) { return fmt.Errorf("%q does not refer to a container: %w", idOrName, define.ErrNoSuchCtr) } - return fmt.Errorf("error retrieving container %q: %w", idOrName, err) + return fmt.Errorf("retrieving container %q: %w", idOrName, err) } // Error out if the container exists in libpod @@ -115,7 +115,7 @@ func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { logrus.Infof("Storage for container %s already removed", ctr.ID) return nil } - return fmt.Errorf("error removing storage for container %q: %w", idOrName, err) + return fmt.Errorf("removing storage for container %q: %w", idOrName, err) } return nil -- cgit v1.2.3-54-g00ecf