Detekt: fix RethrowCaughtException

This commit is contained in:
Benoit Marty 2022-05-12 17:32:00 +02:00
parent 21904054a5
commit aeb6495253
2 changed files with 10 additions and 15 deletions

View file

@ -69,6 +69,7 @@ internal class DefaultSendEventTask @Inject constructor(
}
} catch (e: Throwable) {
// localEchoRepository.updateSendState(params.event.eventId!!, SendState.UNDELIVERED)
Timber.w(e, "Unable to send the Event")
throw e
}
}

View file

@ -15,7 +15,6 @@
*/
package org.matrix.android.sdk.internal.crypto.tasks
import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.internal.crypto.api.CryptoApi
import org.matrix.android.sdk.internal.network.GlobalErrorReceiver
import org.matrix.android.sdk.internal.network.executeRequest
@ -34,20 +33,15 @@ internal class DefaultUploadSignaturesTask @Inject constructor(
) : UploadSignaturesTask {
override suspend fun execute(params: UploadSignaturesTask.Params) {
try {
val response = executeRequest(
globalErrorReceiver,
canRetry = true,
maxRetriesCount = 10
) {
cryptoApi.uploadSignatures(params.signatures)
}
if (response.failures?.isNotEmpty() == true) {
throw Throwable(response.failures.toString())
}
return
} catch (f: Failure) {
throw f
val response = executeRequest(
globalErrorReceiver,
canRetry = true,
maxRetriesCount = 10
) {
cryptoApi.uploadSignatures(params.signatures)
}
if (response.failures?.isNotEmpty() == true) {
throw Throwable(response.failures.toString())
}
}
}