Skip to content

Commit

Permalink
Consistently avoid non-local returns
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbrooks committed Oct 2, 2023
1 parent a910957 commit 47b9af9
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,16 @@ internal class GRPCInterceptor(
val completion = completionParser.parse(headers, emptyMap())
if (completion != null) {
val exception = completion.toConnectExceptionOrNull(serializationStrategy)
return@fold StreamResult.Complete(
StreamResult.Complete(
code = exception?.code ?: Code.OK,
cause = exception,
trailers = headers,
)
} else {
responseCompressionPool = clientConfig
.compressionPool(headers[GRPC_ENCODING]?.first())
StreamResult.Headers(headers)
}
responseCompressionPool = clientConfig.compressionPool(headers[GRPC_ENCODING]?.first())
StreamResult.Headers(headers)
},
onMessage = { result ->
val (_, unpackedMessage) = Envelope.unpackWithHeaderByte(
Expand Down

0 comments on commit 47b9af9

Please sign in to comment.