PrimerError is the error type delivered when a payment or checkout fails. Every error carries a stable errorId for programmatic handling, a diagnosticsId to share with Primer support, and (where applicable) a recoverySuggestion describing how to recover.
PrimerError conforms to LocalizedError and CustomNSError, so you also get localizedDescription for free and can bridge it to NSError when needed.How errors are delivered
You never construct aPrimerError yourself. The SDK delivers it to you through one of two channels, depending on how you present checkout.
See Handle the payment result for the full success / failure / dismissed flow.
Properties
Handling an error
Receive the checkout state through the completion closure and, in the.failure branch, log the diagnosticsId and errorId. Branch on errorId only when you need behavior specific to a category (for example treating a cancellation differently from a hard failure).
PrimerError arrives through the delegate:
See also
PrimerCheckoutState
The checkout state that delivers
.failure(PrimerError).Handle the payment result
Handle success, failure, and dismissal end to end.
PrimerCheckoutPresenter
Receive failures through the presenter delegate.
ValidationResult
Inline field validation, distinct from checkout errors.