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:
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user