mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Detekt: fix RethrowCaughtException
This commit is contained in:
parent
21904054a5
commit
aeb6495253
2 changed files with 10 additions and 15 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue