From d0678bc3e54865faaa68aec359e734656d311f56 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 17 Jan 2016 10:35:38 +0000 Subject: [PATCH] local: report error on stat in Hash in case file disappeared --- local/local.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/local/local.go b/local/local.go index 127a2579f..6753a0e0b 100644 --- a/local/local.go +++ b/local/local.go @@ -444,7 +444,12 @@ func (o *Object) Hash(r fs.HashType) (string, error) { // Check that the underlying file hasn't changed oldtime := o.info.ModTime() oldsize := o.info.Size() - _ = o.lstat() + err := o.lstat() + if err != nil { + fs.Stats.Error() + fs.ErrorLog(o, "Failed to stat: %s", err) + return "", err + } if !o.info.ModTime().Equal(oldtime) || oldsize != o.info.Size() { o.hashes = nil