From ed0143c2402f6e46d90d7c4a1ecf62ef5b85cd22 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 22 Jul 2021 16:20:16 +0200 Subject: [PATCH] Log errors --- .../android/sdk/internal/crypto/OneTimeKeysUploader.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OneTimeKeysUploader.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OneTimeKeysUploader.kt index d11943630e..c4b62fe9fe 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OneTimeKeysUploader.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OneTimeKeysUploader.kt @@ -80,7 +80,7 @@ internal class OneTimeKeysUploader @Inject constructor( val keyLimit = floor(maxOneTimeKeys / 2.0).toInt() if (oneTimeKeyCount == null) { // Ask the server how many otk he has - oneTimeKeyCount = fetchOtkNumber() + oneTimeKeyCount = fetchOtkCount() } val oneTimeKeyCountFromSync = oneTimeKeyCount if (oneTimeKeyCountFromSync != null) { @@ -95,7 +95,7 @@ internal class OneTimeKeysUploader @Inject constructor( // private keys clogging up our local storage. // So we need some kind of engineering compromise to balance all of // these factors. - tryOrNull { + tryOrNull("Unable to upload OTK") { val uploadedKeys = uploadOTK(oneTimeKeyCountFromSync, keyLimit) Timber.v("## uploadKeys() : success, $uploadedKeys key(s) sent") } @@ -106,8 +106,8 @@ internal class OneTimeKeysUploader @Inject constructor( oneTimeKeyCheckInProgress = false } - private suspend fun fetchOtkNumber(): Int? { - return tryOrNull { + private suspend fun fetchOtkCount(): Int? { + return tryOrNull("Unable to get OTK count") { val result = uploadKeysTask.execute(UploadKeysTask.Params(null, null)) result.oneTimeKeyCountsForAlgorithm(MXKey.KEY_SIGNED_CURVE_25519_TYPE) }