Skip to content

TryYourSizeError

TypeTryYourSize (Swift)

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

Each error has a stable code, a message and a docURL. Explanations: Mobile SDK errors.

.secretKeyInApp"secret_key_in_app"Optional

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

.invalidKey"invalid_key"Optional

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

.invalidAppIdentifier"invalid_app_identifier"Optional

The bundle identifier can't be used as an app origin.

.invalidOption"invalid_option"Optional
.windowUnreachable"window_unreachable"Optional

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

.appNotAllowed"app_not_allowed"Optional

This app (ios-app://<bundle id>) is not registered for the key's store.

.signInCancelled"sign_in_cancelled"Optional
.signInUnavailable"sign_in_unavailable"Optional

System-browser sign-in is not available yet.

do {
tys = try TryYourSize(publishableKey: key)
} catch let error as TryYourSizeError where error.code == .secretKeyInApp {
assertionFailure("Use the pk_ key in the app")
}

Was this page helpful?