#[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.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.