From f8e9746e57e6ec8c0dfc16c2963ce6be1729019b Mon Sep 17 00:00:00 2001 From: Alexander Bruy Date: Wed, 11 Oct 2023 16:28:56 +0300 Subject: [PATCH] log errors when project download fails (refs #156) --- mergin/client_pull.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mergin/client_pull.py b/mergin/client_pull.py index 0b1b5ef3..b72fe0fb 100644 --- a/mergin/client_pull.py +++ b/mergin/client_pull.py @@ -130,7 +130,9 @@ def download_project_async(mc, project_path, directory, project_version=None): else: project_info = latest_proj_info - except ClientError: + except ClientError as e: + mp.log.error("Error while downloading project: " + str(e)) + mp.log.info("--- download aborted") _cleanup_failed_download(directory, mp) raise @@ -183,6 +185,8 @@ def download_project_is_running(job): """ for future in job.futures: if future.done() and future.exception() is not None: + job.mp.log.error("Error while downloading project: " + str(future.exception())) + job.mp.log.info("--- download aborted") _cleanup_failed_download(job.directory, job.mp) raise future.exception() if future.running(): @@ -205,6 +209,8 @@ 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: + job.mp.log.error("Error while downloading project: " + str(future.exception())) + job.mp.log.info("--- download aborted") _cleanup_failed_download(job.directory, job.mp) raise future.exception() @@ -694,6 +700,8 @@ def download_file_finalize(job): # make sure any exceptions from threads are not lost for future in job.futures: if future.exception() is not None: + job.mp.log.error("Error while downloading file: " + str(future.exception())) + job.mp.log.info("--- download aborted") raise future.exception() job.mp.log.info("--- download finished")