scp: return better error messages

Fixes #171
This commit is contained in:
Nicola Murino
2020-09-18 19:13:09 +02:00
parent 242dde4480
commit 209badf10c
5 changed files with 59 additions and 18 deletions

View File

@@ -402,6 +402,16 @@ func (GCSFs) IsPermission(err error) bool {
return strings.Contains(err.Error(), "403")
}
// GetPermissionError returns a permission error for this FS
func (GCSFs) GetPermissionError() error {
return errors.New("403 permission denied")
}
// GetNotExistError returns a not exist error for this FS
func (GCSFs) GetNotExistError() error {
return errors.New("404 no such file or directory")
}
// CheckRootPath creates the specified local root directory if it does not exists
func (fs GCSFs) CheckRootPath(username string, uid int, gid int) bool {
// we need a local directory for temporary files