Skip to content

Commit

Permalink
preserve original status cause
Browse files Browse the repository at this point in the history
  • Loading branch information
bong01 committed Feb 9, 2025
1 parent a969a91 commit 6b523e4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions stub/src/main/java/io/grpc/kotlin/ClientCalls.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ import io.grpc.CallOptions
import io.grpc.ClientCall
import io.grpc.MethodDescriptor
import io.grpc.Status
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.cancel
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.onFailure
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
Expand Down Expand Up @@ -296,7 +294,7 @@ object ClientCalls {
val cause =
when {
status.isOk -> null
status.cause is CancellationException -> status.cause
status.cause != null -> status.cause
else -> status.asException(trailersMetadata)
}
responses.close(cause = cause)
Expand Down

0 comments on commit 6b523e4

Please sign in to comment.