Skip to content
You're viewing documentation for v0.6.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Errors

Reference for Email SDK error classes and retry flags.

Email SDK exports four error classes.

Error fields

EmailSdkError includes:

Field Type Notes
code string Machine-readable error code.
provider string Routing name when available.
status number HTTP status when available.
retryable boolean Whether retry is reasonable.
details unknown Adapter response body or extra context.

Common errors

Error When it happens
EmailValidationError A message or client config is invalid.
EmailProviderNotFoundError The selected adapter is not registered.
EmailProviderError An adapter call fails.
EmailSdkError A general SDK-level failure occurs.

Retries and fallbacks

retryable means retrying the same adapter is reasonable. It is not required for fallback. After an adapter finally fails, Email SDK can advance to the next configured fallback adapter.

EmailValidationError from top-level message validation stops the send before adapter attempts. Adapter-specific unsupported-field validation can surface during an adapter attempt, so do not rely on fallback to fix an incompatible message shape. Choose fallback adapters that can represent the same fields your message uses.

When multiple attempted routes fail, Email SDK throws an EmailSdkError with code all_providers_failed and the collected failures in details.

Handling adapter errors

Last updated on