mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:14:42 +01:00
fs/march: improve errors when root source/destination doesn't exist
See: https://forum.rclone.org/t/rclone-attempts-to-read-files-in-the-destination-directory-when-the-source-doesnt-exist/23412
This commit is contained in:
parent
04308dcaa1
commit
1773717a47
@ -404,14 +404,22 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
// Wait for listings to complete and report errors
|
||||
wg.Wait()
|
||||
if srcListErr != nil {
|
||||
if job.srcRemote != "" {
|
||||
fs.Errorf(job.srcRemote, "error reading source directory: %v", srcListErr)
|
||||
} else {
|
||||
fs.Errorf(m.Fsrc, "error reading source root directory: %v", srcListErr)
|
||||
}
|
||||
srcListErr = fs.CountError(srcListErr)
|
||||
return nil, srcListErr
|
||||
}
|
||||
if dstListErr == fs.ErrorDirNotFound {
|
||||
// Copy the stuff anyway
|
||||
} else if dstListErr != nil {
|
||||
if job.dstRemote != "" {
|
||||
fs.Errorf(job.dstRemote, "error reading destination directory: %v", dstListErr)
|
||||
} else {
|
||||
fs.Errorf(m.Fdst, "error reading destination root directory: %v", dstListErr)
|
||||
}
|
||||
dstListErr = fs.CountError(dstListErr)
|
||||
return nil, dstListErr
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user