diff --git a/copy-url.go b/copy-url.go index f202f8c7..c9024a30 100644 --- a/copy-url.go +++ b/copy-url.go @@ -169,7 +169,7 @@ func prepareCopyURLsTypeA(sourceURL string, targetURL string) *copyURLs { sourceContent, err := sourceClient.Stat() if err != nil { // Source does not exist or insufficient privileges. - return ©URLs{Error: iodine.New(errInvalidSource{path: sourceURL}, nil)} + return ©URLs{Error: iodine.New(err, nil)} } if !sourceContent.Type.IsRegular() { // Source is not a regular file @@ -205,7 +205,7 @@ func prepareCopyURLsTypeB(sourceURL string, targetURL string) *copyURLs { sourceContent, err := sourceClient.Stat() if err != nil { // Source does not exist or insufficient privileges. - return ©URLs{Error: iodine.New(errInvalidSource{path: sourceURL}, nil)} + return ©URLs{Error: iodine.New(err, nil)} } if !sourceContent.Type.IsRegular() { diff --git a/pkg/client/fs/fs-errors.go b/pkg/client/fs/fs-errors.go index 3fa3655a..d2d22e72 100644 --- a/pkg/client/fs/fs-errors.go +++ b/pkg/client/fs/fs-errors.go @@ -25,19 +25,19 @@ type GenericFileError struct { type NotFound GenericFileError func (e NotFound) Error() string { - return "Requested file " + e.path + " not found" + return "Requested file [" + e.path + "] not found" } // ISFolder (EISDIR) - accessed file is a folder type ISFolder GenericFileError func (e ISFolder) Error() string { - return "Requested file " + e.path + " is a folder" + return "Requested file [" + e.path + "] is a folder" } // NotFolder (ENOTDIR) - accessed file is not a folder type NotFolder GenericFileError func (e NotFolder) Error() string { - return "Requested file " + e.path + " is not a folder" + return "Requested file [" + e.path + "] is not a folder" } diff --git a/pkg/client/fs/fs.go b/pkg/client/fs/fs.go index b8797e0d..9e66c9fd 100644 --- a/pkg/client/fs/fs.go +++ b/pkg/client/fs/fs.go @@ -57,7 +57,7 @@ func (f *fsClient) fsStat() (os.FileInfo, error) { // Resolve symlinks fpath, err := filepath.EvalSymlinks(f.path) if os.IsNotExist(err) { - return nil, iodine.New(NotFound{path: fpath}, nil) + return nil, iodine.New(NotFound{path: f.path}, nil) } if err != nil { return nil, iodine.New(err, nil) @@ -154,7 +154,7 @@ func (f *fsClient) list(contentCh chan client.ContentOnChannel) { if os.IsNotExist(err) { contentCh <- client.ContentOnChannel{ Content: nil, - Err: iodine.New(NotFound{path: fpath}, nil), + Err: iodine.New(NotFound{path: f.path}, nil), } return }