serenade_http_client/error.rs
1//! [`HttpClientError`] variants.
2
3/// Failure while building or sending an outbound request.
4#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
5pub enum HttpClientError {
6 /// URL or request construction failed.
7 #[error("http client request: {message}")]
8 Request {
9 /// Reason text.
10 message: String,
11 },
12 /// Transport / network failure.
13 #[error("http client transport: {message}")]
14 Transport {
15 /// Reason text.
16 message: String,
17 },
18 /// No mock handler matched (tests only).
19 #[error("http client mock: no handler for {method} {url}")]
20 MockMiss {
21 /// HTTP method.
22 method: String,
23 /// Request URL.
24 url: String,
25 },
26}