From a45ba7046718be484d83eb2c9f0a93535a1f3bc4 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 24 Jan 2019 08:18:55 +0100 Subject: [PATCH] lib/model: Improve errors while pulling (#5474) --- lib/model/folder_sendrecv.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/model/folder_sendrecv.go b/lib/model/folder_sendrecv.go index 792e0fc7d..5f2114efb 100644 --- a/lib/model/folder_sendrecv.go +++ b/lib/model/folder_sendrecv.go @@ -64,7 +64,7 @@ var ( errSymlinksUnsupported = errors.New("symlinks not supported") errDirHasToBeScanned = errors.New("directory contains unexpected files, scheduling scan") errDirHasIgnored = errors.New("directory contains ignored files (see ignore documentation for (?d) prefix)") - errDirNotEmpty = errors.New("directory is not empty") + errDirNotEmpty = errors.New("directory is not empty; files within are probably ignored on connected devices only") errNotAvailable = errors.New("no connected device has the required version of this file") errModified = errors.New("file modified but not rescanned; will try again later") ) @@ -1397,7 +1397,8 @@ func (f *sendReceiveFolder) pullBlock(state pullBlockState, out chan<- *sharedPu // Fetch the block, while marking the selected device as in use so that // leastBusy can select another device when someone else asks. activity.using(selected) - buf, lastError := f.model.requestGlobal(selected.ID, f.folderID, state.file.Name, state.block.Offset, int(state.block.Size), state.block.Hash, state.block.WeakHash, selected.FromTemporary) + var buf []byte + buf, lastError = f.model.requestGlobal(selected.ID, f.folderID, state.file.Name, state.block.Offset, int(state.block.Size), state.block.Hash, state.block.WeakHash, selected.FromTemporary) activity.done(selected) if lastError != nil { l.Debugln("request:", f.folderID, state.file.Name, state.block.Offset, state.block.Size, "returned error:", lastError)