stripe_webhook/
error.rs

1use std::num::ParseIntError;
2
3/// An error encountered when communicating with the Stripe API webhooks.
4#[derive(Debug, thiserror::Error)]
5pub enum WebhookError {
6    #[error("invalid key length")]
7    BadKey,
8    #[error("error parsing timestamp")]
9    BadHeader(#[from] ParseIntError),
10    #[error("error comparing signatures")]
11    BadSignature,
12    #[error("error comparing timestamps - over tolerance")]
13    BadTimestamp(i64),
14    #[error("error parsing event object: {0}")]
15    BadParse(String),
16}