Skip to main content
The SDK throws typed exceptions that you can catch and handle.

Exception classes

The PHP SDK exports:
  • MailGlyphException
  • AuthenticationException
  • ValidationException
  • NotFoundException
  • RateLimitException
  • ApiException

Catch typed exceptions

Key-type mismatch example

events->track() requires a public key and most other methods require a secret key.

Retry and timeout behavior

The PHP SDK automatically retries transient failures:
  • Up to maxRetries retries (default 3)
  • Retries 429 and 5xx responses
  • Retries transport-level HTTP client failures
  • Uses Retry-After when present, otherwise exponential backoff with jitter
Timeout is configured in milliseconds with the timeout client option.
The PHP SDK does not expose a retryAfter property on exceptions. Use the exception type, message, getStatusCode(), and getErrorData() for handling logic.