123456
sealed class PrimerError {  abstract val errorId: String  abstract val description: String  abstract val diagnosticsId: String  abstract val recoverySuggestion: String?}
kotlin
copy

Properties

errorIdStringRequired

A unique error identifier.

descriptionStringRequired

A error description.

recoverySuggestionString?

A recovery suggestion for the given error. In case it's present, use it to try to recover from error.

diagnosticsIdStringRequired

A unique diagnostics id for the given error.

Exposed error Ids

Connectivity Errors

  • bad-network: Indicates a connectivity issue.

HTTP Errors

  • unauthorized: Indicates that the SDK's request lacks valid authentication credentials (HTTP Status-Code 401).
  • client-error: Indicates an error caused by the SDK's request (HTTP Status-Codes 4xx).
  • server-error: Indicates an error caused by the server while processing the SDK's request (HTTP Status-Codes 5xx).

Client Token Errors

  • invalid-client-token: Returned when the provided client token does not have a valid JWT format.
  • expired-client-token: Returned when the provided client token has expired.

Payment Errors

  • payment-failed: Returned when the processing a payment has failed.
  • failed-to-create-payment: Returned when there is a failure in the internal SDK create payment call.
  • failed-to-resume-payment: Returned when there is a failure in the internal SDK resume payment call.
  • payment-cancelled: Returned when the payment was cancelled by the user.

Headless Universal Checkout Specific Errors

  • huc-initialization-failed: Returned when Headless Universal Checkout failed to initialize during the start call.
  • huc-missing-configuration: Returned when internal SDK configuration is not present.
  • huc-invalid-raw-type-data: Returned when the wrong data type is being passed to the setRawData method.
  • invalid-raw-data: Returned when the submit method was called without a prior call to the setRawData method.

Payment Method Errors

Google Pay

  • google-pay-internal: Returned when there is an internal error returned by Google Pay.

Klarna

  • klarna-user-not-approved: Returned when the user declined the Klarna transaction.
  • klarna-sdk-error: Returned when there is an internal error returned by the Klarna SDK.

Apaya

  • apaya-internal: Returned when there is an internal error returned by Apaya.

iPay88

  • payment-failed: Returned when the processing a payment has failed.
  • ipay-sdk-connection-error: Returned when there is an internal connection error returned by iPay88.

Session create error

  • failed-to-create-session: Returned when the Universal Checkout failed to create a session with 3rd party sides (e.g., Klarna, Apaya, etc.).

General Errors

  • missing-configuration: Returned when the internal SDK configuration is not present.
  • invalid-value: Returned when the required data for specific use cases has an invalid format or is missing.
  • invalid-client-session-value: Returned when the required client session data for specific use cases has an invalid format or is missing.
  • failed-to-update-client-session: Returned when the client session fails to update (e.g., selecting a payment method due to a surcharge being present, updating the billing address captured from Google Pay).
  • unknown-error: Returned when the SDK catches an unmapped Exception.