From e43c9202a6a901bbd4c96020c48fd0cc6f69c446 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 12 May 2018 23:54:20 +0200 Subject: [PATCH] archiver: Make sure backend error is passed up --- internal/archiver/archiver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 862c558e8..c6cae0fa6 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -218,6 +218,7 @@ func (arch *Archiver) SaveDir(ctx context.Context, snPath string, fi os.FileInfo for _, name := range names { // test if context has been cancelled if ctx.Err() != nil { + debug.Log("context has been cancelled, aborting") return FutureTree{}, ctx.Err() } @@ -767,7 +768,8 @@ func (arch *Archiver) Snapshot(ctx context.Context, targets []string, opts Snaps t.Kill(nil) werr := t.Wait() - if err != nil && errors.Cause(err) == context.Canceled { + debug.Log("err is %v, werr is %v", err, werr) + if err == nil || errors.Cause(err) == context.Canceled { err = werr }