Skip to content

Commit

Permalink
Fix call to format_exception() download project fails
Browse files Browse the repository at this point in the history
Some users were getting this exception while handling download error:
TypeError: format_exception() missing 2 required positional arguments: 'value' and 'tb'
  • Loading branch information
wonder-sk committed Apr 22, 2024
1 parent b153764 commit dfcc378
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mergin/client_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ def download_project_is_running(job):
"""
for future in job.futures:
if future.done() and future.exception() is not None:
exc = future.exception()
traceback_lines = traceback.format_exception(type(exc), exc, exc.__traceback__)
job.mp.log.error(
"Error while downloading project: " + "".join(traceback.format_exception(future.exception()))
"Error while downloading project: " + "".join(traceback_lines)
)
job.mp.log.info("--- download aborted")
job.failure_log_file = _cleanup_failed_download(job.directory, job.mp)
Expand All @@ -225,8 +227,10 @@ def download_project_finalize(job):
# make sure any exceptions from threads are not lost
for future in job.futures:
if future.exception() is not None:
exc = future.exception()
traceback_lines = traceback.format_exception(type(exc), exc, exc.__traceback__)
job.mp.log.error(
"Error while downloading project: " + "".join(traceback.format_exception(future.exception()))
"Error while downloading project: " + "".join(traceback_lines)
)
job.mp.log.info("--- download aborted")
job.failure_log_file = _cleanup_failed_download(job.directory, job.mp)
Expand Down

0 comments on commit dfcc378

Please sign in to comment.