#[non_exhaustive]pub enum Error {
Transport(TransportError),
Elasticsearch(Box<ElasticsearchError>),
License(Box<LicenseError>),
Conflict(Box<ElasticsearchError>),
Encode(Error),
Parameter(String),
Decode {
status: u16,
source: Error,
body: String,
},
Row(Box<RowError>),
}Expand description
What can go wrong in a call.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(TransportError)
The request couldn’t be sent, or no response came back.
Elasticsearch(Box<ElasticsearchError>)
Elasticsearch answered with an error.
License(Box<LicenseError>)
The cluster’s license doesn’t include a feature the request uses, such as server-side RRF on the Basic license.
Conflict(Box<ElasticsearchError>)
A write conditional on a document’s version found another version: the document changed since it was read (status 409).
Encode(Error)
The request couldn’t be written as JSON.
Parameter(String)
A parameter can’t be written in a URL, or no URL fits the parameters set.
Decode
The response didn’t fit the type it was read into.
Fields
Row(Box<RowError>)
A row of a tabular result, such as an ES|QL query’s, didn’t fit the type it was read into.
Implementations§
Source§impl Error
impl Error
Sourcepub fn from_response(status: u16, body: &[u8]) -> Error
pub fn from_response(status: u16, body: &[u8]) -> Error
The error for a response Elasticsearch failed, from its status and
body: Error::License when the cluster’s license doesn’t include a
feature the request uses, Error::Conflict for a version
conflict, else Error::Elasticsearch.
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()