pub enum HealthError {
UnknownEndpoint(String),
HttpClientCreationFailed(String),
InvalidEndpointUrl {
endpoint: String,
base_url: String,
details: String,
},
}Expand description
Errors that can occur during health checking operations
Variants§
UnknownEndpoint(String)
Endpoint name not found in configuration
Indicates a programming error (endpoint name mismatch) or race condition (config reloaded during request). Should never occur under normal operation.
HttpClientCreationFailed(String)
Failed to create HTTP client for health checks
This indicates a systemic issue (TLS configuration error, resource exhaustion, library bug) rather than an individual endpoint failure. When this error occurs, ALL subsequent health checks will fail.
InvalidEndpointUrl
Invalid endpoint URL configuration
The base_url is malformed or contains invalid components (query parameters, fragments) that would cause health check failures. This is a configuration error.
Implementations§
Source§impl HealthError
impl HealthError
Sourcepub fn error_type(&self) -> &'static str
pub fn error_type(&self) -> &'static str
Get the error type as a string label for metrics
Returns a consistent snake_case string matching the error variant:
UnknownEndpoint→ “unknown_endpoint”HttpClientCreationFailed→ “http_client_failed”InvalidEndpointUrl→ “invalid_url”
Used for Prometheus metric labels to categorize health tracking failures.
Trait Implementations§
Source§impl Debug for HealthError
impl Debug for HealthError
Source§impl Display for HealthError
impl Display for HealthError
Source§impl Error for HealthError
impl Error for HealthError
1.30.0 · 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
Source§impl From<HealthError> for AppError
impl From<HealthError> for AppError
Source§fn from(source: HealthError) -> Self
fn from(source: HealthError) -> Self
Auto Trait Implementations§
impl Freeze for HealthError
impl RefUnwindSafe for HealthError
impl Send for HealthError
impl Sync for HealthError
impl Unpin for HealthError
impl UnwindSafe for HealthError
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.