code: public void writeThrowable(OutputStream out, Throwable value) throws IOException {
          writeStartObject(out);
          writeSerializedField(out, OM_THROWABLE, value);
          StringWriter sw = new StringWriter();
          value.printStackTrace(new PrintWriter(sw));
          writeStringField(out, OM_STACKTRACE, sw.toString());
          writeEndObject(out);
      }
docs: Encode a Throwable instance as JSON:
  {
  "throwable" : Base64,
  "stackTrace" : String
  }
  
  @param out The stream to write JSON to
  @param value The Throwable instance to encode. Can't be null.
  @throws IOException If an I/O error occurs
  @see #readThrowable(InputStream)