elastic_lens/
errors.rs

1//! Any error in ElasticLens is captured here
2
3/// This encapsulates every error which can be emitted
4/// by ElasticLens.  While there are more fine-grained
5/// error types in this crate they can all be converted
6/// to this root type.
7#[derive(Debug, thiserror::Error)]
8pub enum Error {
9    /// Any errors from the internal client adapter
10    #[error("Internal Client Error: {0}")]
11    Adapter(#[from] crate::client::AdapterError),
12
13    /// Any errors related to building a client
14    #[error("Error Building Client: {0}")]
15    ClientBuild(#[from] crate::client::BuilderError),
16
17    /// Any errors related to the client
18    #[error("Client Error: {0}")]
19    Client(#[from] crate::client::ClientError),
20
21    /// Any errors related to bad access of aggregation
22    /// data from the results.
23    #[error("{0}")]
24    AggResultAccess(#[from] crate::response::AggAccessError),
25}