Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(job_attachments): pass original exception to AssetSyncError #285

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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