diff options
| author | Petter Rasmussen | 2016-04-09 18:28:04 +0200 | 
|---|---|---|
| committer | Petter Rasmussen | 2016-04-09 18:37:38 +0200 | 
| commit | 28c5b9beb7b16dc0e1a39fc61163868dcbc02d19 (patch) | |
| tree | 79dcc943d8d1dedab6f5fed180f42dadca23020f /drive/sync_upload.go | |
| parent | 0e1057e475525536dce2db4754e9d9840ab086f2 (diff) | |
| download | gdrive-28c5b9beb7b16dc0e1a39fc61163868dcbc02d19.tar.bz2 | |
Give proper timeout error message
Diffstat (limited to 'drive/sync_upload.go')
| -rw-r--r-- | drive/sync_upload.go | 4 | 
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)  		} | 
