diff options
author | Paul Holzinger <pholzing@redhat.com> | 2024-09-27 14:55:15 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2024-09-27 15:15:23 +0200 |
commit | 1950555b2646fc5a49d5ce66b4b375b386ec063b (patch) | |
tree | ed9fcf9abdd21c9e7218dca769c913b4fa11174f /pkg/domain/infra/abi/containers.go | |
parent | 5c3019e0288830e77ac19ad330ab77a2277be4ae (diff) |
podman mount: some better error wrapping
As shown in #23671 these functions can return the raw error without any
useful context to the user which makes it hard to understand where
things went wrong. Simply add some context to some error paths here.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index d2f99a26f..b6a7baa04 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -1421,7 +1421,7 @@ func (ic *ContainerEngine) ContainerMount(ctx context.Context, nameOrIDs []strin if errors.Is(err, types.ErrContainerUnknown) || errors.Is(err, types.ErrLayerUnknown) || errors.Is(err, define.ErrCtrExists) { continue } - return nil, err + return nil, fmt.Errorf("check if storage container is mounted: %w", err) } var name string @@ -1449,7 +1449,7 @@ func (ic *ContainerEngine) ContainerMount(ctx context.Context, nameOrIDs []strin errors.Is(err, define.ErrCtrRemoved) { continue } - return nil, err + return nil, fmt.Errorf("check if container is mounted: %w", err) } if mounted { |