Enum prometheus_http_query::error::Error
source · #[non_exhaustive]pub enum Error {
Client(ClientError),
Prometheus(PrometheusError),
EmptySeriesSelector,
ParseUrl(ParseUrlError),
}
Expand description
A global error enum that contains all errors that are returned by this
library. Some errors are wrappers for errors from underlying libraries.
All errors (this enum as well as all contained structs) implement std::error::Error
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Client(ClientError)
Wraps errors from the underlying reqwest::Client
that cannot be mapped
to a more specific error type. Deserialization errors also fall into this
category.
Prometheus(PrometheusError)
Occurs when Prometheus responds with e.g. HTTP 4xx (e.g. due to a syntax error in a PromQL query).
Details on the error as reported by Prometheus are included in PrometheusError
.
EmptySeriesSelector
Occurs when the Client::series
method is called with an empty set of
series Selector
s. According to the Prometheus API description at least one
Selector
must be provided.
ParseUrl(ParseUrlError)
Wraps errors from the url
crate.