rigetti / qcs-sdk-rust

Rust SDK for Rigetti Quantum Cloud Services (QCS)
https://docs.rs/qcs
13 stars 5 forks source link

fix(lib)!: clean up Error type variants, prefer error objects to strings #431

Open Shadow53 opened 9 months ago

Shadow53 commented 9 months ago

Resolves #427. See https://github.com/rigetti/qcs-sdk-rust/issues/427#issuecomment-1912571823 for why I did this instead of implementing retry logic.

There are a few main changes here, which all of which are API breaking:

  1. The QcsClient error variant on qpu::execution::Error was only used for translation errors, so it was renamed to better communicate that.
  2. The Translation variant on executable::Error was unused, so I changed the inner type to GrpcClientError from String and changed conversion so the above error variant becomes this one.
  3. I did a brief audit of the other variants on executable::Error using my editor's Find All References feature and deleted anything that had no references.
    • For variants decorated with #[from], I removed that decorator to see if anything broke due to implicit conversions no longer working. Only the variants where this did not introduce errors were deleted.

I'm open to restoring the unused variants and making them used, as appropriate. I figured that it would be good to clean things up while already making breaking changes.

github-actions[bot] commented 9 months ago

PR Preview Action v1.4.6 :---: :rocket: Deployed preview to https://rigetti.github.io/qcs-sdk-rust/pr-preview/pr-431/ on branch qcs-sdk-python-docs at 2024-01-26 22:06 UTC