Skip to main content

worldinterface_http_trigger/
error.rs

1//! Webhook error types.
2
3use crate::types::WebhookId;
4
5#[derive(Debug, thiserror::Error)]
6pub enum WebhookError {
7    /// Webhook path is already registered.
8    #[error("webhook path already registered: {0}")]
9    PathAlreadyRegistered(String),
10
11    /// Webhook not found by ID.
12    #[error("webhook not found: {0}")]
13    WebhookNotFound(WebhookId),
14
15    /// Webhook not found by path (for invocation).
16    #[error("no webhook registered for path: {0}")]
17    PathNotFound(String),
18
19    /// Invalid webhook path (empty, contains invalid characters, etc.)
20    #[error("invalid webhook path: {0}")]
21    InvalidPath(String),
22
23    /// ContextStore error during persistence.
24    #[error("storage error: {0}")]
25    Storage(#[from] worldinterface_contextstore::ContextStoreError),
26
27    /// JSON serialization error.
28    #[error("serialization error: {0}")]
29    Json(#[from] serde_json::Error),
30
31    /// Host error during flow submission.
32    #[error("flow submission error: {0}")]
33    Host(#[from] worldinterface_host::HostError),
34}