diff --git a/src/exo/download/download_utils.py b/src/exo/download/download_utils.py index 618e4f38..5a8feeb9 100644 --- a/src/exo/download/download_utils.py +++ b/src/exo/download/download_utils.py @@ -378,10 +378,14 @@ async def download_file_with_retry( logger.error(traceback.format_exc()) await asyncio.sleep(2.0**attempt) except Exception as e: - on_connection_lost() if attempt == n_attempts - 1: + on_connection_lost() raise e - break + logger.error( + f"Download error on attempt {attempt + 1}/{n_attempts} for {model_id=} {revision=} {path=} {target_dir=}" + ) + logger.error(traceback.format_exc()) + await asyncio.sleep(2.0**attempt) raise Exception( f"Failed to download file {model_id=} {revision=} {path=} {target_dir=}" )