From d60f1ba9baa1f8c285d4984965d1c89dc67a9824 Mon Sep 17 00:00:00 2001 From: Gahyun Suh <132245153+gahyusuh@users.noreply.github.com> Date: Wed, 3 Apr 2024 19:03:22 +0000 Subject: [PATCH] fix(job_attachments): pass original exception to AssetSyncError Signed-off-by: Gahyun Suh <132245153+gahyusuh@users.noreply.github.com> --- src/deadline/job_attachments/download.py | 8 ++++---- src/deadline/job_attachments/upload.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/deadline/job_attachments/download.py b/src/deadline/job_attachments/download.py index 83db330d9..c12f268b8 100644 --- a/src/deadline/job_attachments/download.py +++ b/src/deadline/job_attachments/download.py @@ -122,7 +122,7 @@ def get_manifest_from_s3( error_details=str(bce), ) from bce except Exception as e: - raise AssetSyncError from e + raise AssetSyncError(e) from e def _get_output_manifest_prefix( @@ -220,7 +220,7 @@ def _get_tasks_manifests_keys_from_s3( except JobAttachmentsError: raise # pass along JobAttachmentsErrors if we get them except Exception as e: - raise AssetSyncError from e + raise AssetSyncError(e) from e # 2. Select all files in the last subfolder (alphabetically) under each "task-{any}" folder. for task_folder, files in task_prefixes.items(): @@ -516,7 +516,7 @@ def process_client_error(exc: ClientError, status_code: int): error_details=str(bce), ) from bce except Exception as e: - raise AssetSyncError from e + raise AssetSyncError(e) from e download_logger.debug(f"Downloaded {file.path} to {str(local_file_name)}") os.utime(local_file_name, (modified_time_override, modified_time_override)) # type: ignore[arg-type] @@ -646,7 +646,7 @@ def _get_asset_root_from_s3( error_details=str(bce), ) from bce except Exception as e: - raise AssetSyncError from e + raise AssetSyncError(e) from e return head["Metadata"].get("asset-root", None) diff --git a/src/deadline/job_attachments/upload.py b/src/deadline/job_attachments/upload.py index 734d14ef8..954a0ddd4 100644 --- a/src/deadline/job_attachments/upload.py +++ b/src/deadline/job_attachments/upload.py @@ -432,7 +432,7 @@ def handler(bytes_uploaded): error_details=str(bce), ) from bce except Exception as e: - raise AssetSyncError from e + raise AssetSyncError(e) from e @contextmanager def _open_non_symlink_file_binary( @@ -590,7 +590,7 @@ def file_already_uploaded(self, bucket: str, key: str) -> bool: error_details=str(bce), ) from bce except Exception as e: - raise AssetSyncError from e + raise AssetSyncError(e) from e def upload_bytes_to_s3( self, @@ -644,7 +644,7 @@ def upload_bytes_to_s3( error_details=str(bce), ) from bce except Exception as e: - raise AssetSyncError from e + raise AssetSyncError(e) from e class S3AssetManager: