Academy › Email Verification API Developer Certification › Lesson 2 of 3
Handling results and errors
Your code should treat each result differently.
Results
- deliverable: accept.
- undeliverable: reject, with a friendly message ("Please check your email address").
- risky: usually accept, but flag (catch-all, role or temporary address) according to your rules.
- unknown: accept or ask again later; never block a real person because a check could not finish.
Errors
- 401 / 403: wrong or missing key. Check your configuration.
- 402 or a credits message: out of credits. Alert someone; do not silently reject users.
- 429: too many requests. Wait and retry with increasing pauses (back-off).
- 5xx or a timeout: temporary. Retry a few times, then fall back to accepting.
Set a time limit
Give the check a sensible timeout (a few seconds on a sign-up form) so your page never hangs.
Key idea: map every result to an action, retry politely, and never let an error lock out a real user.