From 043e54950d542ec738bb3e7787862b23796174d8 Mon Sep 17 00:00:00 2001 From: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:26:46 +0200 Subject: [PATCH] Add hint to delete sync snapshot if parsing fails (#853) ## Changes Example error: ``` Error: error parsing existing sync state. Please delete your existing sync snapshot file (.databricks/sync-snapshots/f3c00bc127903f9b.json) and retry: invalid sync state representation. Remote file footxt is missing the corresponding local file ``` ## Tests Manually --- libs/sync/snapshot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/sync/snapshot.go b/libs/sync/snapshot.go index 7e2130e9..f9956962 100644 --- a/libs/sync/snapshot.go +++ b/libs/sync/snapshot.go @@ -168,7 +168,7 @@ func (s *Snapshot) diff(ctx context.Context, all []fileset.File) (diff, error) { currentState := s.SnapshotState if err := currentState.validate(); err != nil { - return diff{}, fmt.Errorf("error parsing existing sync state: %w", err) + return diff{}, fmt.Errorf("error parsing existing sync state. Please delete your existing sync snapshot file (%s) and retry: %w", s.SnapshotPath, err) } // Compute diff to apply to get from current state to new target state.