pub enum ApiErrorKind {
Show 27 variants
Io(Error),
Metrics(MetricError),
Validation(ValidationErrors),
PayloadError(Error),
VapidError(VapidError),
Router(RouterError),
Jwt(Error),
Serde(Error),
ReqwestError(Error),
TokenHashValidation(ErrorStack),
RegistrationSecretHash(ErrorStack),
EndpointUrl(ApcError),
Database(DbError),
Conditional(String),
InvalidToken,
NoUser,
NoSubscription,
InvalidEncryption(String),
InvalidApiVersion,
NoTTL,
InvalidRouterType,
InvalidRouterToken,
InvalidMessageId,
InvalidAuthentication,
InvalidLocalAuth(String),
General(String),
LogCheck,
}
Expand description
The possible errors this application could encounter
Variants§
Io(Error)
Metrics(MetricError)
Validation(ValidationErrors)
PayloadError(Error)
VapidError(VapidError)
Router(RouterError)
Jwt(Error)
Serde(Error)
ReqwestError(Error)
TokenHashValidation(ErrorStack)
RegistrationSecretHash(ErrorStack)
EndpointUrl(ApcError)
Database(DbError)
Conditional(String)
InvalidToken
NoUser
NoSubscription
InvalidEncryption(String)
A specific issue with the encryption headers
InvalidApiVersion
Used if the API version given is not v1 or v2
NoTTL
InvalidRouterType
InvalidRouterToken
InvalidMessageId
InvalidAuthentication
InvalidLocalAuth(String)
General(String)
LogCheck
Implementations§
source§impl ApiErrorKind
impl ApiErrorKind
sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Get the associated HTTP status code
sourcepub fn metric_label(&self) -> Option<&'static str>
pub fn metric_label(&self) -> Option<&'static str>
Specify the label to use for metrics reporting.
sourcepub fn is_sentry_event(&self) -> bool
pub fn is_sentry_event(&self) -> bool
Don’t report all errors to sentry
Trait Implementations§
source§impl Debug for ApiErrorKind
impl Debug for ApiErrorKind
source§impl Display for ApiErrorKind
impl Display for ApiErrorKind
source§impl Error for ApiErrorKind
impl Error for ApiErrorKind
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ApnsError> for ApiErrorKind
impl From<ApnsError> for ApiErrorKind
source§impl From<DbError> for ApiErrorKind
impl From<DbError> for ApiErrorKind
source§impl From<Error> for ApiErrorKind
impl From<Error> for ApiErrorKind
source§impl From<Error> for ApiErrorKind
impl From<Error> for ApiErrorKind
source§impl From<Error> for ApiErrorKind
impl From<Error> for ApiErrorKind
source§impl From<Error> for ApiErrorKind
impl From<Error> for ApiErrorKind
source§impl From<FcmError> for ApiErrorKind
impl From<FcmError> for ApiErrorKind
source§impl From<MetricError> for ApiErrorKind
impl From<MetricError> for ApiErrorKind
source§impl From<RouterError> for ApiErrorKind
impl From<RouterError> for ApiErrorKind
source§fn from(source: RouterError) -> Self
fn from(source: RouterError) -> Self
Converts to this type from the input type.
source§impl From<StubError> for ApiErrorKind
impl From<StubError> for ApiErrorKind
source§impl From<ValidationErrors> for ApiErrorKind
impl From<ValidationErrors> for ApiErrorKind
source§impl From<VapidError> for ApiErrorKind
impl From<VapidError> for ApiErrorKind
source§fn from(source: VapidError) -> Self
fn from(source: VapidError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ApiErrorKind
impl !RefUnwindSafe for ApiErrorKind
impl !Send for ApiErrorKind
impl !Sync for ApiErrorKind
impl Unpin for ApiErrorKind
impl !UnwindSafe for ApiErrorKind
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP