mount: map more rclone errors into file systems errors

This improves the error reporting, in particular for
fs.ErrorPermissionDenied which was being reported as an IO error.
This commit is contained in:
Nick Craig-Wood
2020-04-21 16:31:43 +01:00
parent eed9c5738d
commit 3f654dac37
3 changed files with 12 additions and 12 deletions

View File

@@ -105,11 +105,11 @@ func translateError(err error) syscall.Errno {
switch errors.Cause(err) {
case vfs.OK:
return 0
case vfs.ENOENT:
case vfs.ENOENT, fs.ErrorDirNotFound, fs.ErrorObjectNotFound:
return syscall.ENOENT
case vfs.EEXIST:
case vfs.EEXIST, fs.ErrorDirExists:
return syscall.EEXIST
case vfs.EPERM:
case vfs.EPERM, fs.ErrorPermissionDenied:
return syscall.EPERM
case vfs.ECLOSED:
return syscall.EBADF
@@ -121,7 +121,7 @@ func translateError(err error) syscall.Errno {
return syscall.EBADF
case vfs.EROFS:
return syscall.EROFS
case vfs.ENOSYS:
case vfs.ENOSYS, fs.ErrorNotImplemented:
return syscall.ENOSYS
case vfs.EINVAL:
return syscall.EINVAL