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 <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2024-04-19 16:27:59 +02:00
parent db93e2cf2b
commit ce9054ff45
No known key found for this signature in database
GPG key ID: EB145DD938A3CAF2

View file

@ -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)
}
}