static void writeError(final Context context, final GremlinError error, final MessageSerializer<?> serializer) {
        final ResponseMessage responseMessage = ResponseMessage.build()
                .code(error.getCode())
                .statusMessage(error.getMessage())
                .exception(error.getException())
                .create();

        writeError(context, responseMessage, serializer);
    }
Writes a {@link GremlinError} into the status object of a {@link ResponseMessage} and then flushes it. Used to
send specific errors back to the client. This serves as the end of a response.

@param context       The netty context.
@param error         The GremlinError used to populate the status.
@param serializer    The serializer to use to serialize the error response.
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpHandlerUtil.java