Make NewObject return an error

* make it return an error
  * make a canonical error fs.ErrorNotFound
  * make a test for it
  * remove logs/debugs of error
This commit is contained in:
Nick Craig-Wood
2016-06-28 08:51:57 +01:00
parent b1f131964e
commit ab43005422
13 changed files with 268 additions and 208 deletions
+4 -2
View File
@@ -39,6 +39,7 @@ var (
ErrorDirExists = errors.New("can't copy directory - destination already exists")
ErrorCantSetModTime = errors.New("can't set modified time")
ErrorDirNotFound = errors.New("directory not found")
ErrorObjectNotFound = errors.New("object not found")
ErrorLevelNotSupported = errors.New("level value not supported")
ErrorListAborted = errors.New("list aborted")
ErrorListOnlyRoot = errors.New("can only list from root")
@@ -117,8 +118,9 @@ type Fs interface {
Info
ListFser
// NewObject finds the Object at remote. Returns nil if can't be found
NewObject(remote string) Object
// NewObject finds the Object at remote. If it can't be found
// it returns the error ErrorObjectNotFound.
NewObject(remote string) (Object, error)
// Put in to the remote path with the modTime given of the given size
//