Skip to content

Commit

Permalink
fix(job_attachments): pass original exception to AssetSyncError (#285)
Browse files Browse the repository at this point in the history
Signed-off-by: Gahyun Suh <132245153+gahyusuh@users.noreply.github.com>
  • Loading branch information
gahyusuh authored Apr 3, 2024
1 parent e6ca757 commit c1707b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/deadline/job_attachments/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions src/deadline/job_attachments/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c1707b3

Please sign in to comment.