From 9232d4e44365e0fa344fc5432dfd4843cb4c200c Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Fri, 5 Jun 2020 14:57:11 +0200 Subject: generate systemd: rephrase lookup error Rephrase the lookup error when the specified name or ID does not refer to a container or pod. Until, only the pod-lookup error has been returned which can be confusing when actually looking for a container; a user might have just mistyped the ID or name. Signed-off-by: Valentin Rothberg --- pkg/domain/infra/abi/generate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/domain/infra/abi/generate.go b/pkg/domain/infra/abi/generate.go index abb5e2911..08cb87287 100644 --- a/pkg/domain/infra/abi/generate.go +++ b/pkg/domain/infra/abi/generate.go @@ -40,7 +40,7 @@ func (ic *ContainerEngine) GenerateSystemd(ctx context.Context, nameOrID string, // We're either having a pod or garbage. pod, err := ic.Libpod.LookupPod(nameOrID) if err != nil { - return nil, err + return nil, errors.Errorf("%q does not refer to a container or pod", nameOrID) } // Error out if the pod has no infra container, which we require to be the -- cgit v1.2.3-54-g00ecf