Skip to content

Commit

Permalink
Call.await(): copy exception message when preserving error stack (#9013)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenyomi committed Feb 1, 2023
1 parent 589bdba commit 7559c13
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private suspend fun Call.await(callStack: Array<StackTraceElement>): 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)
}
}
Expand Down

0 comments on commit 7559c13

Please sign in to comment.