Common Errors
The Sendly SDK throws structured errors that you can catch and handle:Common Error Codes
INVALID_EMAIL (400)
The provided email is not valid.
INVALID_DOMAIN (400)
The sending domain is not verified or does not exist.
- Verify that the domain exists
- Configure the DNS records
- Mark the domain as verified
DOMAIN_NOT_FOUND (404)
The domain you are trying to access does not exist.
client.domains.list()
AUTHENTICATION_ERROR (401)
The API key is invalid or has expired.
RATE_LIMIT_EXCEEDED (429)
You have exceeded the request limit.
- Wait before sending more requests
- Implement exponential backoff retries
- Use a processing queue
SERVER_ERROR (500)
Internal server error.
Solution: Retry after a few seconds.
Error Structure
Automatic Retries
Implement retry logic for temporary errors:Pre-validation
Validate data before sending to avoid errors:Error Logging
Log errors for debugging and monitoring:Handling by Error Type
Support
Need help with a specific error? Contact support@usesendly.app with:- Error code
- Error timestamp
- Context (what you were trying to do)
- Your API key (for debugging)