Skip to main content

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.
Solution: Validate the email format before sending.

INVALID_DOMAIN (400)

The sending domain is not verified or does not exist.
Solution:
  1. Verify that the domain exists
  2. Configure the DNS records
  3. Mark the domain as verified

DOMAIN_NOT_FOUND (404)

The domain you are trying to access does not exist.
Solution: Check the domain ID with client.domains.list()

AUTHENTICATION_ERROR (401)

The API key is invalid or has expired.
Solution: Verify your API key in the dashboard.

RATE_LIMIT_EXCEEDED (429)

You have exceeded the request limit.
Solution:
  • 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)