private void handleExceptionWithRequestMetadata(Exception exception,
                                                            ServerCall<I, O> serverCall,
                                                            Metadata metadata) {
                if (exception instanceof IllegalArgumentException) {
                    serverCall.close(Status.INVALID_ARGUMENT.withDescription(exception.getMessage()), metadata);
                } else {
                    serverCall.close(Status.UNAVAILABLE, metadata);
                }
            }
Handles an {@link Exception} with a {@link Metadata} received from a request.
Armeria server MUST filter out pseudo request headers from the response {@link Metadata} when
writing response headers.
Otherwise, the upstream gRPC-Java client raises the following exception:
{@code Http2Exception$StreamException: Mix of request and response pseudo-headers.}
grpc/src/test/java/com/linecorp/armeria/server/grpc/InvalidResponseMetadataTest.java