Error handling
Every provider throws the same normalised PostboiError on failure: HTTP errors,
provider error envelopes, timeouts, and network failures all funnel through it. Error
handling is identical no matter which provider you use, and the original provider payload is
kept on .raw.
Common codes
Beyond provider-specific codes passed through on .code, postboi itself uses a few:
Webhook verification failures throw a WebhookVerificationError (a PostboiError subclass) with codes invalid_signature, missing_secret, stale_timestamp or unsupported_runtime. Return a 401 when you catch one.
Retries
Every provider accepts retries, retry_delay, and timeout:
Retries fire on 429, 5xx, and network errors. The delay doubles each attempt
(exponential backoff).
Retries are off by default on purpose. Retrying a send that already reached the provider can deliver a duplicate email, so enable
retriesonly alongside anidempotency_key(where the provider supports it).