Error handling
connect() and disconnect() throw a sealed WiDASException with stable types, so you can
branch in code. status() never throws.
sealed class WiDASException : Exception() {
data object AttestationUnavailable : WiDASException()
data object AttestationRejected : WiDASException()
data object IssuanceRejected : WiDASException()
data object EntitlementMissing : WiDASException()
data object PasspointInstallFailed : WiDASException()
data object Revoked : WiDASException()
data object Network : WiDASException()
data object Cancelled : WiDASException()
}
The types
| Type | Meaning | What to do |
|---|---|---|
AttestationUnavailable | Play Integrity can't run here (no Play Services, or an unsupported device). | Degrade the UI. Don't loop on it. |
AttestationRejected | Wi-DAS rejected the attestation. | Check the app-signing cert SHA-256 and package name are registered against your partnerId. See the Play App Signing trap. Not worth retrying as-is. |
IssuanceRejected | Issuance was refused (bad CSR/validity/challenge, or an unknown/disabled partner). | Fix the integration; check requestedValidity and your registration. |
EntitlementMissing | Your partner is unknown or disabled, so there's no valid entitlement. | Confirm your partnerId is registered and enabled. |
PasspointInstallFailed | The Passpoint profile wouldn't install. | Check Wi-Fi permissions and that the device supports Passpoint suggestions. |
Revoked | The certificate is revoked. | Call disconnect() to clean up, then tell the user. |
Network | A transport or connectivity failure. | Retry once connectivity is back. |
Cancelled | The operation was cancelled. | Nothing, or retry when the user asks. |
One difference from iOS
Android has no separate serviceUnavailable type. A server-side fault that isn't a refusal on the
merits surfaces as IssuanceRejected or Network. iOS breaks that out into its own
serviceUnavailable case.
Where the types come from
The API reports failures in a structured form, and the SDK maps each one to a typed exception. You
only ever see the sealed WiDASException.
Branching example
try {
widas.connect(user = userId, requestedValidity = "P365D")
} catch (e: WiDASException) {
when (e) {
WiDASException.Network -> scheduleRetry() // transient
WiDASException.AttestationRejected,
WiDASException.EntitlementMissing -> reportConfigProblem() // registration issue
WiDASException.Revoked -> {
widas.disconnect() // clear the dead profile
showRevokedMessage()
}
WiDASException.AttestationUnavailable -> showUnsupportedDevice()
else -> showGenericError()
}
}
Retry the transient cases only
Network is worth a retry with backoff. AttestationRejected, EntitlementMissing, and
IssuanceRejected point at a configuration or registration problem, so retrying without a fix just
fails again. Troubleshooting walks through the fixes.