Raised when a rate limit is exceeded.
Rate-limit errors are always retryable — the caller should wait
:retry_after_ms milliseconds before attempting the send again.
Types
:per_domain— the recipient domain is over its rate limit:per_tenant— the sending tenant is over its rate limit:per_stream— the delivery stream (transactional / operational / bulk) is over its rate limit
Per-kind Fields
:retry_after_ms— non-negative integer milliseconds the caller should wait before retrying. Defaults to0when the caller did not supply it.
See Mailglass.Error for the shared contract and docs/api_stability.md
for the locked :type atom set.
Summary
Functions
Returns the closed set of valid :type atoms. Tested against docs/api_stability.md.
Build a Mailglass.RateLimitError struct.
Types
@type t() :: %Mailglass.RateLimitError{ __exception__: true, cause: Exception.t() | nil, context: %{required(atom()) => term()}, message: String.t(), retry_after_ms: non_neg_integer(), type: :per_domain | :per_tenant | :per_stream }
Functions
@spec __types__() :: [atom()]
Returns the closed set of valid :type atoms. Tested against docs/api_stability.md.
Build a Mailglass.RateLimitError struct.
Options
:cause— an underlying exception to wrap (kept out of JSON output).:context— a map of non-PII metadata;:retry_after_msis also read from context when formatting the message.:retry_after_ms— milliseconds to wait before retrying. When provided, overrides the struct's default0.