Enum elastic_responses::error::ApiError []

pub enum ApiError {
    IndexNotFound {
        index: String,
    },
    DocumentMissing {
        index: String,
    },
    IndexAlreadyExists {
        index: String,
    },
    Parsing {
        line: u64,
        col: u64,
        reason: String,
    },
    MapperParsing {
        reason: String,
    },
    ActionRequestValidation {
        reason: String,
    },
    Other(Map<String, Value>),
    // some variants omitted
}

A REST API error response.

Variants

An index wasn't found.

Some endpoints, like search, will return an IndexNotFound error if a request is made to a missing index. Other endpoints will return a successful response even if the index is missing but include some error property in the response body.

Fields of IndexNotFound

A document wasn't found.

This error can occur when attempting to update a document that doesn't already exist.

Fields of DocumentMissing

An index already exists but was expected to.

Attempting to create an index with a name that's already in use will result in an IndexAlreadyExists error.

Fields of IndexAlreadyExists

The request body contains invalid data.

If a Query DSL query contains invalid JSON or unrecognised properties then Elasticsearch will return a Parsing error.

Fields of Parsing

The document mapping contains invalid data.

If a put mapping request contains invalid JSON or unrecognised properties then Elasticsearch will return a MapperParsing error.

Fields of MapperParsing

The request body can't be processed.

Some endpoints that expect certain constraints of a request to hold will return an ActionRequestValidation error if those constraints aren't met.

Fields of ActionRequestValidation

A currently unrecognised error occurred.

WARNING: Don't rely on this variant to capture an error. As new variants are introduced they will no longer be matched by ApiError::Other. For this reason, this variant will disappear in the future.

Trait Implementations

impl Debug for ApiError
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for ApiError
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Display for ApiError

Formats the value using the given formatter. Read more

impl Error for ApiError

A short description of the error. Read more

The lower-level cause of this error, if any. Read more

impl<'de> Deserialize<'de> for ApiError
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

impl From<Map<String, Value>> for ApiError
[src]

[src]

Performs the conversion.