aboutsummaryrefslogtreecommitdiffstats
path: root/drive/update.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/update.go
parent0e1057e475525536dce2db4754e9d9840ab086f2 (diff)
downloadgdrive-28c5b9beb7b16dc0e1a39fc61163868dcbc02d19.tar.bz2
Give proper timeout error message
Diffstat (limited to 'drive/update.go')
-rw-r--r--drive/update.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/drive/update.go b/drive/update.go
index 7af403f..2ab684e 100644
--- a/drive/update.go
+++ b/drive/update.go
@@ -65,6 +65,9 @@ func (self *Drive) Update(args UpdateArgs) error {
f, err := self.service.Files.Update(args.Id, dstFile).Fields("id", "name", "size").Context(ctx).Media(reader, chunkSize).Do()
if err != nil {
+ if isTimeoutError(err) {
+ return fmt.Errorf("Failed to upload file: timeout, no data was transferred for %v", args.Timeout)
+ }
return fmt.Errorf("Failed to upload file: %s", err)
}