code: public final void write(Throwable e) throws IOException {
      indent();
      newLine();
  
      write(e.toString());
  
      StackTraceElement[] elements = e.getStackTrace();
      for (int i = 0; i < elements.length; i++) {
        newLine();
        write(elements[i].toString());
      }
  
      Throwable cause = e.getCause();
      if (cause != null) {
        newLine();
        write(cause.toString());
      }
  
      outdent();
    }
docs: Write a throwable, used to indicate a problem during data collection, not formatted.
  
  @param e The throwable object
  
  @throws IOException If an I/O error occurs while attempting to write the characters