Skip to content

TryYourSizeException

Typecom.tryyoursize:tryyoursize-android

Every error the SDK raises: a stable code, a message and a doc link (like the web SDK).

Each error has a code (its wire value is the documented code), a message and a docUrl. Explanations: Mobile SDK errors.

SECRET_KEY_IN_APP"secret_key_in_app"Optional

A secret (sk_) or restricted (rk_) key was passed. Those belong on your server.

INVALID_KEY"invalid_key"Optional

Not a publishable key (pk_test_… / pk_live_…).

INVALID_APP_IDENTIFIER"invalid_app_identifier"Optional

The package name can't be used as an app origin.

INVALID_OPTION"invalid_option"Optional
WINDOW_UNREACHABLE"window_unreachable"Optional

Our window did not answer (offline, or blocked).

APP_NOT_ALLOWED"app_not_allowed"Optional

This app (android-app://<package>) is not registered for the key's store.

SIGN_IN_CANCELLED"sign_in_cancelled"Optional
SIGN_IN_UNAVAILABLE"sign_in_unavailable"Optional

System-browser sign-in is not available yet.

try {
tys = TryYourSize(context, key)
} catch (e: TryYourSizeException) {
if (e.code == TryYourSizeException.Code.SECRET_KEY_IN_APP) error("Use the pk_ key")
}

Was this page helpful?