Skip to main content
The SDK returns typed errors that you can inspect with errors.As.

Error types

The Go SDK exports:
  • MailGlyphError
  • AuthenticationError
  • ValidationError
  • NotFoundError
  • RateLimitError
  • ApiError

Catch typed errors

Key-type mismatch example

Events.Track requires a public key and most other methods require a secret key.

Retry and timeout behavior

The Go SDK automatically retries transient API responses:
  • Up to 3 retries for 429 and 5xx responses
  • Uses Retry-After when present (seconds or HTTP date)
  • Falls back to exponential backoff with jitter when Retry-After is missing or invalid
The Go SDK does not retry transport-level request failures. Timeout behavior:
  • mailglyph.WithTimeout(...) sets the underlying http.Client timeout
  • Context cancellation and context deadlines stop retries and return immediately