From 7559c133c05cff0a41d11757ec31c86da7bf5c74 Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Thu, 2 Feb 2023 00:09:35 +0800 Subject: [PATCH] Call.await(): copy exception message when preserving error stack (#9013) --- .../main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt b/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt index db6038714..aa7dbccc6 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt @@ -78,7 +78,7 @@ private suspend fun Call.await(callStack: Array): Response { override fun onFailure(call: Call, e: IOException) { // Don't bother with resuming the continuation if it is already cancelled. if (continuation.isCancelled) return - val exception = IOException(e).apply { stackTrace = callStack } + val exception = IOException(e.message, e).apply { stackTrace = callStack } continuation.resumeWithException(exception) } }