lib/model: Record error for unavailable files (#5066)

This commit is contained in:
Simon Frei 2018-07-14 15:09:23 +02:00 committed by Audrius Butkevicius
parent f822b10550
commit 5592b8b190

View File

@ -66,6 +66,7 @@ var (
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")
errNotAvailable = errors.New("no connected device has the required version of this file")
)
const (
@ -318,8 +319,7 @@ func (f *sendReceiveFolder) processNeeded(ignores *ignore.Matcher, dbUpdateChan
changed++
case runtime.GOOS == "windows" && fs.WindowsInvalidFilename(file.Name):
f.newError("need", file.Name, fs.ErrInvalidFilename)
changed++
f.newError("pull", file.Name, fs.ErrInvalidFilename)
case file.IsDeleted():
if file.IsDirectory() {
@ -353,7 +353,7 @@ func (f *sendReceiveFolder) processNeeded(ignores *ignore.Matcher, dbUpdateChan
return true
}
}
l.Debugln(f, "Needed file is unavailable", file)
f.newError("pull", file.Name, errNotAvailable)
case runtime.GOOS == "windows" && file.IsSymlink():
file.SetUnsupported(f.shortID)