1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum ClientError {
6 #[error("invalid base URL '{0}'")]
8 InvalidBaseUrl(String),
9
10 #[error("invalid endpoint path '{0}'")]
12 InvalidPath(String),
13
14 #[error("unknown OpenAPI operation '{0}'")]
16 UnknownOperation(String),
17
18 #[error("missing required path parameter '{parameter}' for operation '{operation_id}'")]
20 MissingPathParameter {
21 operation_id: String,
22 parameter: String,
23 },
24
25 #[error("request failed: {0}")]
27 Request(#[from] reqwest::Error),
28
29 #[error("failed to parse JSON: {0}")]
31 Json(#[from] serde_json::Error),
32
33 #[error("server returned status {status}: {body}")]
35 HttpStatus {
36 status: reqwest::StatusCode,
37 body: String,
38 },
39}