Raised by Mailglass.Outbound.deliver_many!/2 when one or more
deliveries in the batch have status: :failed.
Never raised by deliver_many/2 — that variant returns
{:ok, [%Delivery{}]} where each delivery carries its own
:status and :last_error. The bang variant is opt-in for callers
who prefer exceptions.
Types
:partial_failure— at least one Delivery succeeded AND at least one failed:all_failed— every Delivery failed
Fields
:failures— list of%Mailglass.Outbound.Delivery{}rows withstatus: :failed. Successful rows are NOT included (caller can retrieve them viadeliver_many/2directly if needed).
Summary
Types
@type t() :: %Mailglass.Error.BatchFailed{ __exception__: true, cause: Exception.t() | nil, context: %{required(atom()) => term()}, failures: [Mailglass.Outbound.Delivery.t()], message: String.t(), type: :partial_failure | :all_failed }
Functions
Returns the closed set of valid :type atoms.
Build a Mailglass.Error.BatchFailed struct.
Options
:cause— an underlying exception to wrap (kept out of JSON output).:context— a map of non-PII metadata;:count= total deliveries attempted,:failed_count= number that failed.:failures— list of%Mailglass.Outbound.Delivery{}rows that failed.