Skip to content

Commit

Permalink
drive: return error when fail to create file system
Browse files Browse the repository at this point in the history
  • Loading branch information
mawaya committed Sep 5, 2020
1 parent 986bf08 commit 07e5a6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/drive/drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ func NewFs(name, path string, m configmap.Mapper) (fs.Fs, error) {
// isFileID := false
var srcFile *drive.File
if rootID, _ := parseRootID(path); len(rootID) > 6 {
f.opt.RootFolderID = rootID

err = f.pacer.Call(func() (bool, error) {
srcFile, err = f.svc.Files.Get(rootID).
Expand All @@ -1382,7 +1383,6 @@ func NewFs(name, path string, m configmap.Mapper) (fs.Fs, error) {
if err == nil {
if srcFile.MimeType != "" && srcFile.MimeType != "application/vnd.google-apps.folder" {
fs.Debugf(nil, "Root ID (File): %s", rootID)
f.opt.RootFolderID = rootID
} else {
if srcFile.DriveId == rootID {
fs.Debugf(nil, "Root ID (Drive): %s", rootID)
Expand All @@ -1395,6 +1395,8 @@ func NewFs(name, path string, m configmap.Mapper) (fs.Fs, error) {
srcFile = nil
}
f.isTeamDrive = f.opt.TeamDriveID != ""
} else {
return nil, err
}
}

Expand Down

0 comments on commit 07e5a6e

Please sign in to comment.