@@ -1184,7 +1184,7 @@ class ServerCallsTest : AbstractCallsTest() {
1184
1184
}
1185
1185
}
1186
1186
1187
- val receivedStatusCause = CompletableDeferred <Throwable ?>()
1187
+ val receivedStatus = CompletableDeferred <Status ?>()
1188
1188
1189
1189
val interceptor = object : ServerInterceptor {
1190
1190
override fun <ReqT , RespT > interceptCall (
@@ -1195,7 +1195,7 @@ class ServerCallsTest : AbstractCallsTest() {
1195
1195
next.startCall(
1196
1196
object : ForwardingServerCall .SimpleForwardingServerCall <ReqT , RespT >(call) {
1197
1197
override fun close (status : Status , trailers : Metadata ) {
1198
- receivedStatusCause .complete(status.cause )
1198
+ receivedStatus .complete(status)
1199
1199
super .close(status, trailers)
1200
1200
}
1201
1201
},
@@ -1213,11 +1213,13 @@ class ServerCallsTest : AbstractCallsTest() {
1213
1213
// the exception should not propagate to the client
1214
1214
assertThat(clientException.cause).isNull()
1215
1215
1216
- assertThat(clientException.status.code).isEqualTo(Status .Code .INTERNAL )
1217
- val statusCause = receivedStatusCause .await()
1216
+ assertThat(clientException.status.code).isEqualTo(Status .Code .UNKNOWN )
1217
+ val status = receivedStatus .await()!!
1218
1218
// but the exception should propagate to server interceptors, with stack trace intact
1219
- assertThat(statusCause).isEqualTo(thrownStatusCause.await())
1220
- assertThat(statusCause!! .stackTraceToString()).contains(" internalServerCall" )
1219
+ assertThat(status.code).isEqualTo(Status .UNKNOWN .code)
1220
+ assertThat(status.description).isEqualTo(" Unknown Exception" )
1221
+ assertThat(status.cause).isEqualTo(thrownStatusCause.await())
1222
+ assertThat(status.cause?.stackTraceToString()).contains(" internalServerCall" )
1221
1223
}
1222
1224
1223
1225
}
0 commit comments