From b12bba4e2af1f990117003e94580b424d009ca79 Mon Sep 17 00:00:00 2001 From: n0npax Date: Sun, 19 Nov 2017 11:40:47 +0100 Subject: [PATCH] fix #1411 replace panic during index save with fatal error --- cmd/restic/cmd_rebuild_index.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_rebuild_index.go b/cmd/restic/cmd_rebuild_index.go index 92cbf3360..9480374ea 100644 --- a/cmd/restic/cmd_rebuild_index.go +++ b/cmd/restic/cmd_rebuild_index.go @@ -3,6 +3,7 @@ package main import ( "context" + "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/restic" @@ -66,7 +67,7 @@ func rebuildIndex(ctx context.Context, repo restic.Repository, ignorePacks resti id, err := idx.Save(ctx, repo, supersedes) if err != nil { - return err + return errors.Fatalf("unable to save index, last error was: %v", err) } Verbosef("saved new index as %v\n", id.Str())