pushes exception upward if triggered
This commit is contained in:
+2
@@ -27,6 +27,7 @@ import com.vitorpamplona.quartz.utils.Log
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.tasks.await
|
import kotlinx.coroutines.tasks.await
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
import kotlin.coroutines.cancellation.CancellationException
|
||||||
|
|
||||||
object PushNotificationUtils {
|
object PushNotificationUtils {
|
||||||
var lastToken: String? = null
|
var lastToken: String? = null
|
||||||
@@ -44,6 +45,7 @@ object PushNotificationUtils {
|
|||||||
|
|
||||||
registerToken(token, accounts, okHttpClient)
|
registerToken(token, accounts, okHttpClient)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
if (e is CancellationException) throw e
|
||||||
Log.e("PushNotificationUtils", "Failed to get Firebase token", e)
|
Log.e("PushNotificationUtils", "Failed to get Firebase token", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -26,6 +26,7 @@ import android.net.Uri
|
|||||||
import com.vitorpamplona.quartz.nip55AndroidSigner.api.IResult
|
import com.vitorpamplona.quartz.nip55AndroidSigner.api.IResult
|
||||||
import com.vitorpamplona.quartz.nip55AndroidSigner.api.SignerResult
|
import com.vitorpamplona.quartz.nip55AndroidSigner.api.SignerResult
|
||||||
import com.vitorpamplona.quartz.utils.Log
|
import com.vitorpamplona.quartz.utils.Log
|
||||||
|
import kotlinx.coroutines.CancellationException
|
||||||
|
|
||||||
fun <T : IResult> ContentResolver.query(
|
fun <T : IResult> ContentResolver.query(
|
||||||
uri: Uri,
|
uri: Uri,
|
||||||
@@ -51,6 +52,7 @@ fun <T : IResult> ContentResolver.query(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
if (e is CancellationException) throw e
|
||||||
Log.e("ExternalSignerLauncher", "Failed to query the Signer app in the background", e)
|
Log.e("ExternalSignerLauncher", "Failed to query the Signer app in the background", e)
|
||||||
SignerResult.RequestIncomplete.ErrorExceptionCallingContentResolver(e)
|
SignerResult.RequestIncomplete.ErrorExceptionCallingContentResolver(e)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user