Errors

Structured error codes and recovery guidance for the Kotlin SDK.

Kotlin SDK methods throw VoidhashException on failure, carrying a stable, machine-matchable code. Match on error.code when recovery differs, and report the full error for everything else:

try {
    val products = voidhash.getProducts()
} catch (error: VoidhashException) {
    if (error.code == "FAILED_TO_GET_PRODUCTS") {
        // retry, fall back to cached products, …
    }
}

Operation codes

These codes name the client operation that failed. The message text is informational — never match on it.

CodeThrown byRecovery guidance
CONFIGURATION_MISSINGAny call before init succeedsRetry after initialize() succeeds.
FAILED_TO_GET_CURRENT_PERSONgetCurrentPerson()Serve cached state; see Check access.
FAILED_TO_SET_PERSON_ATTRIBUTESsetPersonAttributes()Retry later.
FAILED_TO_IDENTIFYidentify()Retry; an already-identified person surfaces this code too.
FAILED_TO_GET_FEATURE_FLAGSgetFeatureFlags()Fall back to defaults.
FAILED_TO_GET_PRODUCTSgetProducts()Retry or render without store metadata.
FAILED_TO_PURCHASEpurchase(...)Reserved for the later commerce launch.
FAILED_TO_RESTORE_PURCHASESrestorePurchases()Prompt the customer to retry.
FAILED_TO_FLUSH_ANALYTICSflush()Events stay queued and flush later.

Client-state codes

CodeMeaning
READ_ONLY_PURCHASE_NOT_ALLOWEDPurchase initiation is unavailable in the observer-only release.
UNSUPPORTED_PLATFORMA platform-specific method ran elsewhere.
UNKNOWNAn unexpected failure. Report the full error.

Next steps