pub type ErrorCause = Box<dyn std::error::Error + Send + Sync>;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum ProviderError {
#[error("transport failure while {context}")]
Transport {
context: String,
#[source]
cause: ErrorCause,
},
#[error("provider error while {context}: {message}")]
Provider {
context: String,
message: String,
status: Option<u16>,
},
#[error("undecodable response while {context}")]
Decode {
context: String,
#[source]
cause: ErrorCause,
},
#[error("unsupported request: {reason}")]
Unsupported {
reason: String,
},
}
pub trait ContextProvider: Send + Sync {
fn name(&self) -> &str;
}