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

Properties

errorId
StringRequired
A unique error identifier.
errorCode
String?
A unique error code.
description
StringRequired
A error description.
A recovery suggestion for the given error. In case it's present, use it to try to recover from error.
diagnosticsId
StringRequired
A unique diagnostics id for the given error.

Exposed error Ids and error codes

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.

nol Pay

  • nol-pay-sdk-error: Returned when there is an error returned by Nol Pay. Errors can be distinguished by errorCode:
    • A3300: Failed to init Transit SDK
    • A3301: Error on request parameter
    • A3302: Network error
    • A3304: Failed to handle response payload
    • A3305: API call failed
    • A3310: Mobile phone does not support NFC
    • A3311: NFC disabled on mobile phone
    • A3312: Invalid NFC Tag
    • A3313: NFC disconnected, user should hold Nol card until scanning finises
    • A3314: NFC Command error

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.