pub enum StripeWebhookError {
Show 15 variants
MissingSecret,
InvalidSecretFormat(String),
MissingSignature,
InvalidSignatureFormat(String),
SignatureVerificationFailed,
TimestampTooOld {
age_seconds: i64,
max_age_seconds: i64,
},
TimestampInFuture {
drift_seconds: i64,
},
InvalidPayload(String),
UnknownEventType(String),
MissingField(String),
AlreadyProcessed {
event_id: String,
},
ProcessingFailed(String),
DatabaseError(String),
ExternalServiceError(String),
InternalError(String),
}Expand description
Stripe webhook error types with HTTP status code mapping
Variants§
MissingSecret
Missing webhook signing secret
InvalidSecretFormat(String)
Invalid secret format
MissingSignature
Missing stripe-signature header
InvalidSignatureFormat(String)
Invalid signature format
SignatureVerificationFailed
Signature verification failed
TimestampTooOld
Timestamp too old (replay attack protection)
TimestampInFuture
Timestamp in future (clock skew)
InvalidPayload(String)
Failed to parse request body
UnknownEventType(String)
Unknown event type
MissingField(String)
Missing required field in event
AlreadyProcessed
Event already processed (idempotent)
ProcessingFailed(String)
Event processing failed
DatabaseError(String)
Database error during processing
ExternalServiceError(String)
External service error
InternalError(String)
Internal error
Implementations§
Source§impl StripeWebhookError
impl StripeWebhookError
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Get the HTTP status code for this error
Sourcepub fn should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Check if this error should be retried by Stripe
Stripe will retry webhooks that return 5xx errors. We return false for client errors (4xx) to prevent retries.
Sourcepub fn error_code(&self) -> &'static str
pub fn error_code(&self) -> &'static str
Get error code for logging/metrics
Trait Implementations§
Source§impl Debug for StripeWebhookError
impl Debug for StripeWebhookError
Source§impl Display for StripeWebhookError
impl Display for StripeWebhookError
Source§impl Error for StripeWebhookError
impl Error for StripeWebhookError
1.30.0 · 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 IntoResponse for StripeWebhookError
impl IntoResponse for StripeWebhookError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for StripeWebhookError
impl RefUnwindSafe for StripeWebhookError
impl Send for StripeWebhookError
impl Sync for StripeWebhookError
impl Unpin for StripeWebhookError
impl UnwindSafe for StripeWebhookError
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
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.