From 5aa706831f136b1ce054777bcda65675701a9ac0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 17 Mar 2019 14:31:30 +0000 Subject: [PATCH] b2: ignore already_hidden error on remove Sometimes (possibly through eventual consistency) b2 returns an already_hidden error on a delete. Ignore this since it is harmless. --- backend/b2/b2.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 75dbd6783..d9e5cb967 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -952,6 +952,13 @@ func (f *Fs) hide(Name string) error { return f.shouldRetry(resp, err) }) if err != nil { + if apiErr, ok := err.(*api.Error); ok { + if apiErr.Code == "already_hidden" { + // sometimes eventual consistency causes this, so + // ignore this error since it is harmless + return nil + } + } return errors.Wrapf(err, "failed to hide %q", Name) } return nil