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.
| Code | Thrown by | Recovery guidance |
|---|---|---|
CONFIGURATION_MISSING | Any call before init succeeds | Retry after initialize() succeeds. |
FAILED_TO_GET_CURRENT_PERSON | getCurrentPerson() | Serve cached state; see Check access. |
FAILED_TO_SET_PERSON_ATTRIBUTES | setPersonAttributes() | Retry later. |
FAILED_TO_IDENTIFY | identify() | Retry; an already-identified person surfaces this code too. |
FAILED_TO_GET_FEATURE_FLAGS | getFeatureFlags() | Fall back to defaults. |
FAILED_TO_GET_PRODUCTS | getProducts() | Retry or render without store metadata. |
FAILED_TO_PURCHASE | purchase(...) | Reserved for the later commerce launch. |
FAILED_TO_RESTORE_PURCHASES | restorePurchases() | Prompt the customer to retry. |
FAILED_TO_FLUSH_ANALYTICS | flush() | Events stay queued and flush later. |
Client-state codes
| Code | Meaning |
|---|---|
READ_ONLY_PURCHASE_NOT_ALLOWED | Purchase initiation is unavailable in the observer-only release. |
UNSUPPORTED_PLATFORM | A platform-specific method ran elsewhere. |
UNKNOWN | An unexpected failure. Report the full error. |