rigetti / qcs-sdk-rust

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

Prefer inspectable objects in errors over Strings #427

Open Shadow53 opened 8 months ago

Shadow53 commented 8 months ago

The SDK does not differentiate between gRPC status codes received e.g. during translation, and converts all of them into string messages. This makes it difficult for consumers to detect when the failure is a transient one that should succeed after a couple tries, such as when the translation backend is under load and temporarily rejects new requests.

Shadow53 commented 8 months ago

After hacking on this locally, I've determined there isn't a good way to implement retrying in a centralized way until https://github.com/hyperium/tonic/issues/733 is resolved. Even then, such a centralized implementation should live in the API client packages rather than the higher-level SDK.

Until then, a simpler way to handle this in the SDK is to expose the actual gRPC Status through the error instead of converting into a String.