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 BYOB job results bytes typing issue #1220

Merged
merged 8 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
10 changes: 7 additions & 3 deletions qiskit_ibm_runtime/runtime_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,13 @@ def _error_msg_from_job_response(self, response: Dict) -> str:
job_result_raw = self._download_external_result(
self._api_client.job_results(job_id=self.job_id())
)
index = job_result_raw.rfind("Traceback")
if index != -1:
job_result_raw = job_result_raw[index:]

try:
index = job_result_raw.rfind("Traceback")
if index != -1:
job_result_raw = job_result_raw[index:]
except TypeError:
pass
kt474 marked this conversation as resolved.
Show resolved Hide resolved

if status == "CANCELLED" and self._reason == "RAN TOO LONG":
error_msg = API_TO_JOB_ERROR_MESSAGE["CANCELLED - RAN TOO LONG"]
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/byte-result-bug-7afb5abe813f5b1b.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fixed an issue where canceled and failed jobs would return an invalid result that
resulted in a type error, preventing the actual error from being returned
to the user.
Loading