pub enum WebhookError {
RequestFailed(String),
MaxRetriesExceeded,
SerializationError(String),
InvalidUrl(String),
SchemeNotAllowed(String),
BlockedIpAddress(String),
DnsResolutionFailed(String),
}Expand description
Webhook-related errors
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::RequestFailed("Network timeout".to_string());
assert_eq!(error.to_string(), "Webhook request failed: Network timeout");Variants§
RequestFailed(String)
HTTP request failed
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::RequestFailed("Connection refused".to_string());MaxRetriesExceeded
Max retries exceeded
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::MaxRetriesExceeded;
assert_eq!(error.to_string(), "Max retries exceeded for webhook");SerializationError(String)
Serialization error
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::SerializationError("Invalid JSON".to_string());InvalidUrl(String)
Invalid URL format
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::InvalidUrl("not-a-url".to_string());SchemeNotAllowed(String)
URL scheme not allowed (only HTTPS is permitted)
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::SchemeNotAllowed("http".to_string());BlockedIpAddress(String)
SSRF protection: URL resolves to blocked IP address
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::BlockedIpAddress("127.0.0.1".to_string());DnsResolutionFailed(String)
DNS resolution failed
§Example
use reinhardt_tasks::webhook::WebhookError;
let error = WebhookError::DnsResolutionFailed("example.invalid".to_string());Trait Implementations§
Source§impl Debug for WebhookError
impl Debug for WebhookError
Source§impl Display for WebhookError
impl Display for WebhookError
Source§impl Error for WebhookError
impl Error for WebhookError
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()
Auto Trait Implementations§
impl Freeze for WebhookError
impl RefUnwindSafe for WebhookError
impl Send for WebhookError
impl Sync for WebhookError
impl Unpin for WebhookError
impl UnsafeUnpin for WebhookError
impl UnwindSafe for WebhookError
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> 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.