Something went wrong. Try again.
The smokesignal.events web application forked from smokesignal.events/smokesignal
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758use thiserror::Error;
/// Represents errors that can occur during webhook processing.////// These errors typically occur when processing webhook notifications,/// including service validation, DID resolution, and HTTP request failures.#[derive(Debug, Error)]pub(crate) enum WebhookError { /// Error when a service doesn't end with the required suffix. /// /// This error occurs when validating a webhook service URL that doesn't /// end with the expected automation service suffix. #[error("error-smokesignal-webhook-1 Service must end with {suffix}")] InvalidServiceSuffix { suffix: String },
/// Error when failing to get a DID document. /// /// This error occurs when attempting to retrieve a DID document /// for service validation fails. #[error("error-smokesignal-webhook-2 Failed to get DID document for {did}: {error}")] DidDocumentRetrievalFailed { did: String, error: String },
/// Error when a DID document is not found. /// /// This error occurs when a required DID document cannot be found /// in the system. #[error("error-smokesignal-webhook-3 DID document not found for {did}")] DidDocumentNotFound { did: String },
/// Error when a service is not found in a DID document. /// /// This error occurs when a DID document doesn't contain the expected /// automation service entry. #[error("error-smokesignal-webhook-4 service not found in DID document")] ServiceNotFoundInDidDocument,
/// Error when JWT creation fails. /// /// This error occurs when attempting to create a JWT token for /// webhook authentication fails. #[error("error-smokesignal-webhook-5 Failed to create JWT: {error}")] JwtCreationFailed { error: String },
/// Error when a webhook request fails with an error response. /// /// This error occurs when the webhook endpoint returns an error /// status code or the request fails. #[error("error-smokesignal-webhook-6 Webhook failed: {error}")] WebhookRequestFailed { error: String },
/// Error when a webhook request fails due to network or other issues. /// /// This error occurs when the HTTP request to the webhook endpoint /// fails due to network issues or other transport problems. #[error("error-smokesignal-webhook-7 Webhook request failed: {error}")] WebhookTransportFailed { error: String },}