From 959c5e1a8d562f4eed0536fd7c539707e52a827d Mon Sep 17 00:00:00 2001 From: Rick Bijkerk Date: Mon, 15 Apr 2024 12:45:02 +0200 Subject: [PATCH] add more info to errors (#77) Co-authored-by: Rick Bijkerk --- internal/business/persisted_operations/loader.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/business/persisted_operations/loader.go b/internal/business/persisted_operations/loader.go index 0250fed..87cc986 100644 --- a/internal/business/persisted_operations/loader.go +++ b/internal/business/persisted_operations/loader.go @@ -3,6 +3,7 @@ package persisted_operations // nolint:revive import ( "context" "errors" + "fmt" "log/slog" ) @@ -31,7 +32,7 @@ func determineLoader(cfg Config, log *slog.Logger) (RemoteLoader, error) { if cfg.Remote.GcpBucket != "" { loader, err := NewGcpStorageLoader(context.Background(), cfg.Remote.GcpBucket, cfg.Store, log) if err != nil { - return nil, errors.New("unable to instantiate GcpBucketLoader") + return nil, fmt.Errorf("unable to instantiate GcpBucketLoader err: %w", err) } return loader, nil }