EncoreError
EncoreError is a sealed, nested enum. Errors surface by being thrown from try await placement(_:).show() (and other throws APIs like revokeEntitlements()) — they are not delivered as a NotGrantedReason. User dismissals and “no offers” are business outcomes, not errors; see NotGrantedReason.
Never block user actions on an SDK error. Always provide a fallback path so the user can complete their intended action — your onPassthrough handler already runs for not-granted outcomes; wrap try await show() in do/catch and proceed on error too.
Definition
Top-level cases
Nested cases
Helpers
Every EncoreError conforms to LocalizedError, so errorDescription gives a developer-readable summary. transport and protocol(.decoding) errors also expose the wrapped system error via the underlying property:
Handling errors
- NotGrantedReason — business outcomes (dismiss, no offers, experiment control, unsupported OS). These are not errors.
- PresentationResult — the value returned by
try await show().
The most common “failure” is not an error at all — it’s the user declining an offer, surfaced as a NotGrantedReason. Reserve do/catch for genuine transport, protocol, and integration failures.