Mailglass.SuppressedError exception (Mailglass v0.1.0)

Copy Markdown View Source

Raised when delivery is blocked by the suppression list.

Suppression is a permanent policy block — the recipient opted out, hard-bounced, or the tenant explicitly excluded them. Never retryable. The :type atoms mirror Mailglass.Suppression.scope for 1:1 match.

Types

  • :address — the recipient address is globally suppressed
  • :domain — the recipient domain is globally suppressed
  • :address_stream — the recipient is suppressed for a specific stream (e.g. :bulk)

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.

Types

t()

@type t() :: %Mailglass.SuppressedError{
  __exception__: true,
  cause: Exception.t() | nil,
  context: %{required(atom()) => term()},
  message: String.t(),
  type: :address | :domain | :address_stream
}

Functions

__types__()

(since 0.1.0)
@spec __types__() :: [atom()]

Returns the closed set of valid :type atoms. Tested against docs/api_stability.md.

new(type, opts \\ [])

(since 0.1.0)
@spec new(
  atom(),
  keyword()
) :: t()

Build a Mailglass.SuppressedError struct.

Options

  • :cause — an underlying exception to wrap (kept out of JSON output).
  • :context — a map of non-PII metadata about the suppression record.