From ce9054ff45b5804acc8bb26470eab4ba41a2b5cf Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 19 Apr 2024 16:27:59 +0200 Subject: [PATCH] libpod: wrap store setup error message In cases where we fail to configure the error is returned as it and may be missing useful context. Make sure we know the error happened as part of the storage setup. Signed-off-by: Paul Holzinger --- libpod/runtime.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpod/runtime.go b/libpod/runtime.go index ad8eaa4eda..b9a89ae6c2 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -438,7 +438,7 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) { } } - return err + return fmt.Errorf("configure storage: %w", err) } defer func() { if retErr != nil && store != nil { @@ -616,7 +616,7 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) { // Ensure we have a store before refresh occurs if runtime.store == nil { if err := runtime.configureStore(); err != nil { - return err + return fmt.Errorf("configure storage: %w", err) } }