XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
754 stars 191 forks source link

Add error details for failed remote job #370

Closed pauljxtan closed 4 years ago

pauljxtan commented 4 years ago

Context:

Currently, a failed remote job produces a generic error message that is difficult to diagnose. The job info response from the remote platform contains a meta field that is currently unused, but has some information that may be useful, e.g.,

{
    'error_code': 'hardware-message-error',
    'error_detail': 'The job failed because the message received from the hardware could not be understood.'
}

Description of the Change:

Example:

Benefits:

The added context in a copy-pastable error message is likely to make it easier to diagnose and debug job failures.

Possible Drawbacks:

The new error message is slightly verbose.

Related GitHub Issues:

N/A

codecov[bot] commented 4 years ago

Codecov Report

Merging #370 into master will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #370   +/-   ##
=======================================
  Coverage   97.69%   97.70%           
=======================================
  Files          52       52           
  Lines        6478     6485    +7     
=======================================
+ Hits         6329     6336    +7     
  Misses        149      149           
Impacted Files Coverage Δ
strawberryfields/api/connection.py 100.00% <ø> (ø)
strawberryfields/engine.py 94.90% <ø> (ø)
strawberryfields/api/job.py 94.11% <100.00%> (+0.93%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5917bac...4c81ff2. Read the comment docs.

pauljxtan commented 4 years ago

Just FYI, @lneuhaus and I coordinated an end-to-end test for a deliberately failing job and didn't find any problems.

antalszava commented 4 years ago

Thanks so much for this @pauljxtan, looks really good! :100: Had a couple of suggestions which might be improvements to add, but I'm also happy with the current state.