pub enum EveryMapError {
HttpError {
status: u16,
message: String,
body: Option<String>,
},
AuthError {
message: String,
provider: String,
},
ProviderError {
provider: String,
code: String,
message: String,
},
RateLimited {
provider: String,
retry_after_secs: Option<u64>,
},
ValidationError(String),
SerializationError {
source: Error,
},
ClientError(Error),
UnsupportedDomain {
provider: String,
domain: String,
},
Unknown,
}Expand description
Unified error type for all EveryMap operations.
Provides structured error information across HTTP, authentication, provider-specific, rate limiting, and validation scenarios.
Variants§
HttpError
HTTP request failed with a status code.
AuthError
Authentication failed (invalid API key, expired token, etc.).
ProviderError
Provider-specific error (e.g., HERE returned an error response).
RateLimited
Rate limited by the provider.
ValidationError(String)
Request validation failed (invalid coordinates, missing required fields, etc.).
SerializationError
Failed to deserialize a response body.
ClientError(Error)
An error occurred in the underlying HTTP client.
UnsupportedDomain
The requested domain is not supported by this provider.
Unknown
An unknown or unexpected error occurred.
Implementations§
Source§impl EveryMapError
impl EveryMapError
Sourcepub fn http(status: u16, message: impl Into<String>) -> Self
pub fn http(status: u16, message: impl Into<String>) -> Self
Create an HTTP error from a status code and message.
Sourcepub fn http_with_body(
status: u16,
message: impl Into<String>,
body: impl Into<String>,
) -> Self
pub fn http_with_body( status: u16, message: impl Into<String>, body: impl Into<String>, ) -> Self
Create an HTTP error with a response body.
Sourcepub fn provider(
provider: impl Into<String>,
code: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn provider( provider: impl Into<String>, code: impl Into<String>, message: impl Into<String>, ) -> Self
Create a provider error.
Sourcepub fn auth(provider: impl Into<String>, message: impl Into<String>) -> Self
pub fn auth(provider: impl Into<String>, message: impl Into<String>) -> Self
Create an auth error.
Sourcepub fn rate_limited(
provider: impl Into<String>,
retry_after_secs: Option<u64>,
) -> Self
pub fn rate_limited( provider: impl Into<String>, retry_after_secs: Option<u64>, ) -> Self
Create a rate limit error.
Sourcepub fn is_status(&self, status: u16) -> bool
pub fn is_status(&self, status: u16) -> bool
Check if this is an HTTP error with the given status code.
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Check if this is a rate limit error (HTTP 429).
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
Check if this is an authentication error (HTTP 401 or 403).
Trait Implementations§
Source§impl Debug for EveryMapError
impl Debug for EveryMapError
Source§impl Display for EveryMapError
impl Display for EveryMapError
Source§impl Error for EveryMapError
impl Error for EveryMapError
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()
Source§impl From<Error> for EveryMapError
impl From<Error> for EveryMapError
Auto Trait Implementations§
impl !RefUnwindSafe for EveryMapError
impl !UnwindSafe for EveryMapError
impl Freeze for EveryMapError
impl Send for EveryMapError
impl Sync for EveryMapError
impl Unpin for EveryMapError
impl UnsafeUnpin for EveryMapError
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.