From 409e4936af17ee3f5c565b52c55b575daa64f5aa Mon Sep 17 00:00:00 2001 From: Juergen Hoetzel Date: Wed, 25 Aug 2021 15:46:21 +0200 Subject: [PATCH 1/2] Improve snapshot filter warning message Include the root-cause why the snapshot prefix is ignored. --- cmd/restic/find.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/find.go b/cmd/restic/find.go index 70710e2cb..1297420f9 100644 --- a/cmd/restic/find.go +++ b/cmd/restic/find.go @@ -31,7 +31,7 @@ func FindFilteredSnapshots(ctx context.Context, repo *repository.Repository, hos } else { id, err = restic.FindSnapshot(ctx, repo, s) if err != nil { - Warnf("Ignoring %q, it is not a snapshot id\n", s) + Warnf("Ignoring %q: %v\n", s, err) continue } } From defe19fdf637321569d7ccb3cfd67ba230565db2 Mon Sep 17 00:00:00 2001 From: Juergen Hoetzel Date: Wed, 25 Aug 2021 16:11:28 +0200 Subject: [PATCH 2/2] Quote snapshot prefix in error string --- internal/restic/backend_find.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/restic/backend_find.go b/internal/restic/backend_find.go index 631c7088a..b85cc9199 100644 --- a/internal/restic/backend_find.go +++ b/internal/restic/backend_find.go @@ -10,7 +10,7 @@ import ( type MultipleIDMatchesError struct{ prefix string } func (e *MultipleIDMatchesError) Error() string { - return fmt.Sprintf("multiple IDs with prefix %s found", e.prefix) + return fmt.Sprintf("multiple IDs with prefix %q found", e.prefix) } // A NoIDByPrefixError is returned by Find() when no ID for a given prefix