pub enum Hook0ClientError {
Show 18 variants
AuthHeader(InvalidHeaderValue),
ReqwestClient(Error),
Url(ParseError),
EventSending {
event_id: Option<Uuid>,
error: Error,
body: Option<String>,
},
InvalidEventType(String),
GetAvailableEventTypes(Error),
CreatingEventType {
event_type_name: String,
error: Error,
},
InvalidSignature,
ExpiredWebhook {
signed_at: DateTime<Utc>,
tolerance: Duration,
current_time: DateTime<Utc>,
},
SignatureHeaderParsing(String),
TimestampParsing {
timestamp: String,
error: ParseIntError,
},
V0SignatureParsing {
signature: String,
error: FromHexError,
},
HeaderNameParsing {
header: String,
error: InvalidHeaderName,
},
V1SignatureParsing {
signature: String,
error: FromHexError,
},
MissingHeader(HeaderName),
InvalidHeaderName {
header_name: String,
error: InvalidHeaderName,
},
InvalidHeaderValue {
header_name: HeaderName,
header_value: String,
error: FromUtf8Error,
},
InvalidTolerance(OutOfRangeError),
}Expand description
Every error Hook0 client can encounter
Variants§
AuthHeader(InvalidHeaderValue)
Cannot build a structurally-valid Authorization header
This is an internal error that is unlikely to happen.
ReqwestClient(Error)
Cannot build a Reqwest HTTP client
This is an internal error that is unlikely to happen.
Url(ParseError)
Cannot build a structurally-valid endpoint URL
This is an internal error that is unlikely to happen.
EventSending
Something went wrong when sending an event to Hook0
Fields
InvalidEventType(String)
Provided event type does not have a valid syntax
GetAvailableEventTypes(Error)
Something went wrong when trying to fetch the list of available event types
CreatingEventType
Something went wrong when creating an event type
InvalidSignature
The webhook signature is invalid
ExpiredWebhook
The webhook has expired because it was sent too long ago
Fields
SignatureHeaderParsing(String)
Could not parse signature header
TimestampParsing
Could not parse timestamp in signature
V0SignatureParsing
Could not parse v0 signature
HeaderNameParsing
Could not parse header names (h field)
V1SignatureParsing
Could not parse v1 signature
MissingHeader(HeaderName)
A header present in the webhook’s signature was not provided with a value
InvalidHeaderName
Provided header has an invalid name
InvalidHeaderValue
Provided header has an invalid value
InvalidTolerance(OutOfRangeError)
Invalid tolerance Duration
Implementations§
Source§impl Hook0ClientError
impl Hook0ClientError
Sourcepub fn log_and_return(self) -> Self
pub fn log_and_return(self) -> Self
Log the error (using the tracing crate) and return it as a result of this function’s call
Trait Implementations§
Source§impl Debug for Hook0ClientError
impl Debug for Hook0ClientError
Source§impl Display for Hook0ClientError
impl Display for Hook0ClientError
Source§impl Error for Hook0ClientError
impl Error for Hook0ClientError
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
use the Display impl or to_string()
Auto Trait Implementations§
impl !Freeze for Hook0ClientError
impl !RefUnwindSafe for Hook0ClientError
impl Send for Hook0ClientError
impl Sync for Hook0ClientError
impl Unpin for Hook0ClientError
impl UnsafeUnpin for Hook0ClientError
impl !UnwindSafe for Hook0ClientError
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> 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.