aboutsummaryrefslogtreecommitdiffstats
path: root/drive/sync_upload.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-04-09 18:28:04 +0200
committerPetter Rasmussen2016-04-09 18:37:38 +0200
commit28c5b9beb7b16dc0e1a39fc61163868dcbc02d19 (patch)
tree79dcc943d8d1dedab6f5fed180f42dadca23020f /drive/sync_upload.go
parent0e1057e475525536dce2db4754e9d9840ab086f2 (diff)
downloadgdrive-28c5b9beb7b16dc0e1a39fc61163868dcbc02d19.tar.bz2
Give proper timeout error message
Diffstat (limited to 'drive/sync_upload.go')
-rw-r--r--drive/sync_upload.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/drive/sync_upload.go b/drive/sync_upload.go
index c509c0a..bb1ab33 100644
--- a/drive/sync_upload.go
+++ b/drive/sync_upload.go
@@ -317,6 +317,8 @@ func (self *Drive) uploadMissingFile(parentId string, lf *LocalFile, args Upload
exponentialBackoffSleep(try)
try++
return self.uploadMissingFile(parentId, lf, args, try)
+ } else if isTimeoutError(err) {
+ return fmt.Errorf("Failed to upload file: timeout, no data was transferred for %v", args.Timeout)
} else {
return fmt.Errorf("Failed to upload file: %s", err)
}
@@ -356,6 +358,8 @@ func (self *Drive) updateChangedFile(cf *changedFile, args UploadSyncArgs, try i
exponentialBackoffSleep(try)
try++
return self.updateChangedFile(cf, args, try)
+ } else if isTimeoutError(err) {
+ return fmt.Errorf("Failed to upload file: timeout, no data was transferred for %v", args.Timeout)
} else {
return fmt.Errorf("Failed to update file: %s", err)
}