#[non_exhaustive]pub enum Error {
NoQuestions,
DuplicateId(String),
InvalidCriteria {
id: Option<String>,
reason: &'static str,
},
Config {
reason: String,
},
Auth {
status: u16,
detail: ErrorDetail,
},
BadRequest {
status: u16,
detail: ErrorDetail,
},
RateLimited {
retry_after: Option<Duration>,
detail: ErrorDetail,
},
Overloaded {
detail: ErrorDetail,
},
Http {
status: u16,
detail: ErrorDetail,
},
Protocol {
id: Option<String>,
reason: String,
},
Json(Error),
Transport(Box<dyn Error + Send + Sync>),
}Expand description
An error produced while constructing, sending, or decoding a Jev request.
Match this non-exhaustive enum when recovery differs by category. API
failures expose ErrorDetail, including the request ID used by support.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoQuestions
Match this to add a question before encoding the request again.
DuplicateId(String)
Match this to report a duplicated application-defined question ID.
InvalidCriteria
Match this to report invalid runtime-defined options or levels.
Fields
id: Option<String>Use this to identify the question a Questions
builder method rejected; DynOptions::new
and DynLevels::new leave it None.
Config
Match this when client configuration must be corrected before retrying.
Auth
Match this to replace a missing or rejected API key before retrying.
Fields
detail: ErrorDetailUse these details for diagnostics and the server request ID.
BadRequest
Match this to correct a semantic or structural request error.
Fields
detail: ErrorDetailUse these details to explain why the request was rejected.
RateLimited
Match this when a caller needs to observe exhausted 429 retries.
Fields
detail: ErrorDetailUse these details for diagnostics and the server request ID.
Overloaded
Match this when a caller needs to observe exhausted 529 retries.
Fields
detail: ErrorDetailUse these details for diagnostics and the server request ID.
Http
Match this as the fallback for an otherwise unclassified HTTP failure.
Fields
detail: ErrorDetailUse these details for diagnostics and the server request ID.
Protocol
Match this when an API response does not agree with the request schema.
Fields
Json(Error)
Match this when serialized state or a response body is invalid JSON.
Transport(Box<dyn Error + Send + Sync>)
Match this to inspect a failure from the selected I/O adapter.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()