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

Adding file path to BatchTask error message for clarity. #380

Merged
merged 2 commits into from
Aug 9, 2023
Merged
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
5 changes: 4 additions & 1 deletion src/bloqade/task/cloud_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections import OrderedDict
import datetime
import json
import os
import sys
import numpy as np
import traceback
Expand Down Expand Up @@ -232,6 +233,7 @@ def submit(self, shuffle_submit_order: bool = True) -> CloudBatchResultSubType:
future_file = f"partial-batch-future-{time_stamp}.json"
error_file = f"partial-batch-errors-{time_stamp}.json"

cwd = os.get_cwd()
cloud_batch_result.save_json(future_file, indent=2)

with open(error_file, "w") as f:
Expand All @@ -240,7 +242,8 @@ def submit(self, shuffle_submit_order: bool = True) -> CloudBatchResultSubType:
raise CloudBatchTask.SubmissionException(
"One or more error(s) occured during submission, please see "
"the following files for more information:\n"
f" - {future_file}\n - {error_file}\n"
f" - {os.path.join(cwd, future_file)}\n"
f" - {os.path.join(cwd, error_file)}\n"
)

else:
Expand Down
Loading