Error classes
WrapsEmailError
Base error class. All SDK errors extend this class. Use it to catch any SDK-originated error without distinguishing the type.
ValidationError
Thrown when input fails validation before the request reaches SES. Check error.field to identify which parameter is invalid.
| Property | Type | Description |
|---|---|---|
field | string | The parameter name that failed validation (e.g. 'from', 'to'). |
message | string | Human-readable description of the validation failure. |
SESError
Thrown when AWS SES returns an error. Check error.retryable to determine whether the operation can be retried.
| Property | Type | Description |
|---|---|---|
code | string | AWS error code returned by SES (e.g. 'MessageRejected', 'Throttling'). |
retryable | boolean | true if the error is transient and the request can be retried. |
Common errors and fixes
Missing or unverified from address
Missing or unverified from address
Error:
ValidationError — from address is not verified in SES.Fix: Your from address must belong to a domain you have verified in SES. Add and verify your domain:Rate limit exceeded
Rate limit exceeded
Error:
SESError with code: 'Throttling' and retryable: true.Fix: Implement exponential backoff when error.retryable is true.Invalid email address format
Invalid email address format
Error:
ValidationError with field: 'to' or field: 'from'.Fix: Ensure all email addresses are valid RFC 5321 addresses. Validate user input before passing it to send().SES sandbox restrictions
SES sandbox restrictions
Error:
SESError with code: 'MessageRejected' — recipient address is not verified.Fix: New AWS accounts start in SES sandbox mode, where you can only send to verified email addresses or the SES mailbox simulator. To send to any recipient, request production access:- Open the SES console.
- Choose Request production access.
- Complete the form. Approval typically takes up to 24 hours.
