qcs_api_client_grpc/tonic/
error.rs1use http::{header::InvalidHeaderValue, uri::InvalidUri};
2use tonic::transport::Error as TransportError;
3
4use qcs_api_client_common::configuration::LoadError;
5
6use super::{channel::ChannelError, RequestBodyDuplicationError};
7
8#[derive(Debug, thiserror::Error)]
10#[allow(variant_size_differences)]
11pub enum Error<E>
12where
13 E: std::error::Error,
14{
15 #[error("failed to refresh access token: {0}")]
17 Refresh(#[source] E),
18 #[error("failed to load QCS config: {0}")]
20 Load(#[from] LoadError),
21 #[error("failed to parse URI: {0}")]
23 InvalidUri(#[from] InvalidUri),
24 #[error("service call failed with error: {0}")]
26 Transport(#[from] TransportError),
27 #[error("access token is not a valid header value: {0}")]
29 InvalidAccessToken(#[source] InvalidHeaderValue),
30 #[error("The channel configuration caused an error: {0}")]
32 ChannelError(#[from] ChannelError),
33 #[cfg(feature = "grpc-web")]
34 #[error("The hyper grpc-web client returned an error: {0}")]
35 HyperError(#[from] hyper::Error),
36 #[error("failed to duplicate request body for retry: {0}")]
37 CloneBody(#[from] RequestBodyDuplicationError),
38}