Skip to content

Commit 2cc3e06

Browse files
ppolewiczmlech-reef
authored andcommitted
Merge pull request #522 from Backblaze/catch_timeout
Add upload token reset after upload timeout
2 parents 26f45a5 + bcf467c commit 2cc3e06

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

b2sdk/_internal/b2http.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,8 @@ def _translate_errors(cls, fcn, post_params=None):
551551
# an upload request for cause, so we use a 400 Bad Request
552552
# code.
553553
raise BrokenPipe()
554+
elif isinstance(e2, TimeoutError):
555+
raise B2RequestTimeout(str(e0))
554556
raise B2ConnectionError(str(e0))
555557

556558
except requests.Timeout as e:

b2sdk/_internal/bounded_queue_executor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def submit(self, fcn, *args, **kwargs):
5454
def run_it():
5555
try:
5656
return fcn(*args, **kwargs)
57-
except Exception:
57+
except Exception as exc:
58+
print(exc)
5859
self.num_exceptions += 1
5960
raise
6061
finally:

changelog.d/+17dd34ae.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add upload token reset after upload timeout.

0 commit comments

Comments
 (0)