Raised when tenant context is required but not stamped on the process.
Mailglass.Tenancy.tenant_id!/0 raises this when the calling process has
not been stamped via Mailglass.Tenancy.put_current/1 (typically from an
on_mount/4 callback, Plug, or test setup). Callers that already hold
tenant context may use tenant_id!/0 as a fail-loud accessor; callers that
want the configured default instead should use Mailglass.Tenancy.current/0.
Types
:unstamped— no tenant_id present in the process dictionary:webhook_tenant_unresolved— the configuredMailglass.Tenancyresolver returned{:error, _}fromresolve_webhook_tenant/1for an authenticated webhook request (Phase 4 D-14). Distinct from:unstamped— the request is cryptographically verified, but the adopter's tenancy module could not map it to a known tenant. Plan 05 formalizes the optional@callback resolve_webhook_tenant/1and thedocs/api_stability.md §Tenancylock; Plan 04 Task 2 adds the atom as a precondition forMailglass.Webhook.Plug's 422 rescue clause.
Never retryable — the caller failed to establish tenant context.
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.TenancyError struct.
Types
@type t() :: %Mailglass.TenancyError{ __exception__: true, cause: Exception.t() | nil, context: %{required(atom()) => term()}, message: String.t(), type: :unstamped | :webhook_tenant_unresolved }
Functions
@spec __types__() :: [atom()]
Returns the closed set of valid :type atoms. Tested against docs/api_stability.md.
Build a Mailglass.TenancyError struct.
Options
:cause— an underlying exception to wrap (kept out of JSON output).:context— a map of non-PII metadata about the call site.