From dbabb18b0cc508d471a4b19b56f478da1c967ab9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 25 Jan 2018 09:51:43 +0000 Subject: [PATCH] vfs: Make error messages more informative #2009 --- vfs/write.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vfs/write.go b/vfs/write.go index 8c1b47156..d212cfcda 100644 --- a/vfs/write.go +++ b/vfs/write.go @@ -280,7 +280,7 @@ func (fh *WriteFileHandle) Truncate(size int64) (err error) { return ECLOSED } if size != fh.offset { - fs.Errorf(fh.remote, "WriteFileHandle: Truncate: Can't change size without cache") + fs.Errorf(fh.remote, "WriteFileHandle: Truncate: Can't change size without --vfs-cache-mode >= writes") return EPERM } // File is correct size @@ -292,7 +292,7 @@ func (fh *WriteFileHandle) Truncate(size int64) (err error) { // Read reads up to len(p) bytes into p. func (fh *WriteFileHandle) Read(p []byte) (n int, err error) { - fs.Errorf(fh.remote, "WriteFileHandle: Read: Can't read and write to file without cache") + fs.Errorf(fh.remote, "WriteFileHandle: Read: Can't read and write to file without --vfs-cache-mode >= minimal") return 0, EPERM } @@ -300,7 +300,7 @@ func (fh *WriteFileHandle) Read(p []byte) (n int, err error) { // underlying input source. It returns the number of bytes read (0 <= // n <= len(p)) and any error encountered. func (fh *WriteFileHandle) ReadAt(p []byte, off int64) (n int, err error) { - fs.Errorf(fh.remote, "WriteFileHandle: ReadAt: Can't read and write to file without cache") + fs.Errorf(fh.remote, "WriteFileHandle: ReadAt: Can't read and write to file without --vfs-cache-mode >= minimal") return 0, EPERM }