@Override
        public void write(OutputStream output) throws IOException, WebApplicationException {
          OutputStreamWriter writer = new OutputStreamWriter(output);
          gson.toJson(new JsonError(ex.getCause().getMessage()), writer);
          writer.flush();
        }
Handled media types
@return media types
gson/src/org/immutables/gson/stream/GsonMessageBodyProvider.java