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

Use error code 1305 instead of hard coding error msg #1760

Merged
merged 7 commits into from
Jul 8, 2024

Conversation

kt474
Copy link
Member

@kt474 kt474 commented Jun 19, 2024

Summary

Instead of hard coding the error reason "RAN TOO LONG", use the error code returned from the API instead.

Example:

~/Documents/qiskit-ibm-runtime/qiskit_ibm_runtime/runtime_job_v2.py in result(self, timeout, decoder)
    137             error_message = self._reason if self._reason else self._error_message
    138             if self._reason_code == 1305:
--> 139                 raise RuntimeJobMaxTimeoutError(error_message)
    140             raise RuntimeJobFailureError(f"Unable to retrieve job result. {error_message}")
    141         if self._status == "CANCELLED":

RuntimeJobMaxTimeoutError: 'Error code 1305; Ran too long'

Details and comments

Fixes #989

@kt474 kt474 marked this pull request as ready for review June 20, 2024 16:54
@coveralls
Copy link

coveralls commented Jun 20, 2024

Pull Request Test Coverage Report for Build 9601363645

Details

  • 8 of 10 (80.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 82.04%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/runtime_job_v2.py 0 2 0.0%
Totals Coverage Status
Change from base Build 9584804898: 0.04%
Covered Lines: 6080
Relevant Lines: 7411

💛 - Coveralls

@kt474 kt474 requested a review from SamFerracin June 21, 2024 16:14
@coveralls
Copy link

coveralls commented Jun 21, 2024

Pull Request Test Coverage Report for Build 9616583670

Details

  • 8 of 10 (80.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 82.04%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/runtime_job_v2.py 0 2 0.0%
Totals Coverage Status
Change from base Build 9605113454: 0.04%
Covered Lines: 6080
Relevant Lines: 7411

💛 - Coveralls

qiskit_ibm_runtime/base_runtime_job.py Outdated Show resolved Hide resolved
@kt474 kt474 added the on hold label Jun 24, 2024
@kt474 kt474 removed the on hold label Jul 8, 2024
@kt474 kt474 merged commit 475b96f into Qiskit:main Jul 8, 2024
18 checks passed
@kt474 kt474 deleted the use-reason-code-1305 branch July 8, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use status code instead of Ran too long
3 participants