private void renderError(ErrorMessage error) throws IOException {
        generator.writeRaw("event: error\n");
        generator.writeRaw("data: ");
        JsonRenderer.renderError(generator, error);
        generator.writeRaw("\n\n");
        generator.flush();
    }
A Server-Sent Events (SSE) renderer for asynchronous events such as
tokens from a language model.

@author lesters
container-search/src/main/java/com/yahoo/search/rendering/EventRenderer.java