Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Request to expose error code along with the error message #691

Closed
SooluThomas opened this issue Aug 2, 2023 · 0 comments · Fixed by #692
Closed

Request to expose error code along with the error message #691

SooluThomas opened this issue Aug 2, 2023 · 0 comments · Fixed by #692
Assignees
Labels
priority: high type: enhancement Existing functionality improvement
Milestone

Comments

@SooluThomas
Copy link
Member

What is the expected enhancement?

It will be nice to see the error code along with the error message. The current implementation simply returns the error message and there's no way to get the error code. This issue requests for that enhancement.

Thank you!

Background

I'm running

source = """
OPENQASM 4.0;
"""

job = backend.run(source)
result = job.result()
counts = result.get_counts()

and I'm supposed to get error in this case. I get

Traceback (most recent call last):
  Cell In[5], line 6
    result = job.result()
  File /opt/conda/lib/python3.10/site-packages/qiskit_ibm_provider/job/ibm_circuit_job.py:250 in result
    raise IBMJobFailureError(f"Job failed: " f"{error_message}")
IBMJobFailureError: 'Job failed: Internal Error'

It will be nice to be able to see something like IBMJobFailureError: 'Job failed - Error code: 9999; Error message: Internal Error'

@SooluThomas SooluThomas added the type: enhancement Existing functionality improvement label Aug 2, 2023
@kt474 kt474 self-assigned this Aug 2, 2023
@kt474 kt474 added this to the 0.6.3 milestone Aug 6, 2023
@kt474 kt474 closed this as completed in #692 Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: high type: enhancement Existing functionality improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants