diff --git a/android/app/src/main/kotlin/com/yubico/authenticator/yubikit/DeviceInfoHelper.kt b/android/app/src/main/kotlin/com/yubico/authenticator/yubikit/DeviceInfoHelper.kt index 161446f4..7c975760 100644 --- a/android/app/src/main/kotlin/com/yubico/authenticator/yubikit/DeviceInfoHelper.kt +++ b/android/app/src/main/kotlin/com/yubico/authenticator/yubikit/DeviceInfoHelper.kt @@ -18,10 +18,10 @@ suspend fun getDeviceInfo(device: YubiKeyDevice): Info { val deviceInfo = runCatching { device.withConnection { DeviceUtil.readInfo(it, pid) } - }.onFailure { + }.recoverCatching { Log.d(OathManager.TAG, "Smart card connection not available") device.withConnection { DeviceUtil.readInfo(it, pid) } - }.onFailure { + }.recoverCatching { Log.d(OathManager.TAG, "OTP connection not available") device.withConnection { DeviceUtil.readInfo(it, pid) } }.getOrElse {