@@ -66,6 +66,9 @@ def wrapper(*args, **kwargs):
66
66
67
67
time .sleep ((2 ** n ) + random .randint (0 , 1000 ) / 1000 )
68
68
except HttpError as e :
69
+ if e .content == '' :
70
+ raise
71
+
69
72
try :
70
73
error = json .loads (e .content )
71
74
except ValueError :
@@ -75,7 +78,7 @@ def wrapper(*args, **kwargs):
75
78
76
79
if error .get ('code' ) == 403 and \
77
80
error .get ('errors' )[0 ].get ('reason' ) \
78
- in ['rateLimitExceeded' , 'userRateLimitExceeded' ]:
81
+ in ['rateLimitExceeded' , 'userRateLimitExceeded' ]:
79
82
# Apply exponential backoff.
80
83
_logger .exception ("There was a transient HTTP "
81
84
"error (%s). Trying again (%d): "
@@ -95,8 +98,7 @@ def wrapper(*args, **kwargs):
95
98
# We had a resolvable authorization problem.
96
99
97
100
_logger .info ("There was an authorization fault under "
98
- "action [%s]. Attempting refresh." ,
99
- action )
101
+ "action [%s]. Attempting refresh." , action )
100
102
101
103
authorize = get_auth ()
102
104
authorize .check_credential_state ()
@@ -706,6 +708,10 @@ def update_entry(self, normalized_entry, filename=None, data_filepath=None,
706
708
request ,
707
709
data_filepath is not None )
708
710
711
+ if gdrivefs .config .IS_DEBUG is True :
712
+ _logger .debug ("Update result: [%s]\n %s" ,
713
+ normalized_entry .id , pprint .pformat (result ))
714
+
709
715
normalized_entry = NormalEntry ('update_entry' , result )
710
716
711
717
_logger .debug ("Entry with ID [%s] updated." , normalized_entry .id )
@@ -720,8 +726,8 @@ def __finish_upload(self, filename, request, has_file):
720
726
if has_file is False :
721
727
return request .execute ()
722
728
723
- _logger .debug ("We needed to update the entry's data. Doing "
724
- "chunked-upload." )
729
+ _logger .debug ("We need to finish updating the entry's data: [%s]" ,
730
+ filename )
725
731
726
732
result = None
727
733
while result is None :
0 commit comments