pub enum WebhookError {
HostNotConfigured,
RegistrationNotFound {
topic: WebhookTopic,
},
GraphqlError(GraphqlError),
ShopifyError {
message: String,
},
SubscriptionNotFound {
topic: WebhookTopic,
},
InvalidHmac,
NoHandlerForTopic {
topic: String,
},
PayloadParseError {
message: String,
},
}Expand description
Error type for webhook registration and verification operations.
This enum provides error types for webhook operations, including host configuration errors, registration lookup failures, signature verification failures, and wrapped GraphQL errors.
§Example
use shopify_sdk::webhooks::WebhookError;
use shopify_sdk::rest::resources::v2025_10::common::WebhookTopic;
// Create a registration not found error
let error = WebhookError::RegistrationNotFound {
topic: WebhookTopic::OrdersCreate,
};
assert!(error.to_string().contains("not found"));Variants§
HostNotConfigured
Host URL is not configured in ShopifyConfig.
This error occurs when attempting to register webhooks but
config.host() returns None. The host URL is required to
construct callback URLs for webhook subscriptions.
RegistrationNotFound
Webhook registration not found in the local registry.
This error occurs when attempting to register a webhook topic
that hasn’t been added to the registry via add_registration().
Fields
topic: WebhookTopicThe webhook topic that was not found.
GraphqlError(GraphqlError)
An underlying GraphQL error occurred.
This variant wraps GraphqlError for unified error handling.
ShopifyError
A Shopify API error occurred (from userErrors in GraphQL response).
This error is returned when the GraphQL mutation succeeds (HTTP 200) but Shopify returns userErrors in the response body.
SubscriptionNotFound
Webhook subscription not found in Shopify.
This error occurs when attempting to unregister a webhook that doesn’t exist in Shopify for the given topic.
Fields
topic: WebhookTopicThe webhook topic that was not found.
InvalidHmac
Webhook signature verification failed.
This error occurs when the HMAC signature in the webhook request does not match the expected signature computed from the request body. The error message is intentionally generic to avoid leaking security details.
NoHandlerForTopic
No handler registered for the webhook topic.
This error occurs when attempting to process a webhook for a topic that has no registered handler in the registry.
PayloadParseError
Webhook payload parsing failed.
This error occurs when the webhook request body cannot be parsed as valid JSON.