Skip to content

Commit 6b523e4

Browse files
committed
preserve original status cause
1 parent a969a91 commit 6b523e4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

stub/src/main/java/io/grpc/kotlin/ClientCalls.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ import io.grpc.CallOptions
2020
import io.grpc.ClientCall
2121
import io.grpc.MethodDescriptor
2222
import io.grpc.Status
23-
import kotlinx.coroutines.CancellationException
2423
import kotlinx.coroutines.CoroutineName
2524
import kotlinx.coroutines.NonCancellable
2625
import kotlinx.coroutines.cancel
2726
import kotlinx.coroutines.channels.Channel
2827
import kotlinx.coroutines.channels.onFailure
2928
import kotlinx.coroutines.coroutineScope
3029
import kotlinx.coroutines.flow.Flow
31-
import kotlinx.coroutines.flow.collect
3230
import kotlinx.coroutines.flow.flow
3331
import kotlinx.coroutines.launch
3432
import kotlinx.coroutines.withContext
@@ -296,7 +294,7 @@ object ClientCalls {
296294
val cause =
297295
when {
298296
status.isOk -> null
299-
status.cause is CancellationException -> status.cause
297+
status.cause != null -> status.cause
300298
else -> status.asException(trailersMetadata)
301299
}
302300
responses.close(cause = cause)

0 commit comments

Comments
 (0)