code: private String formatException(Throwable throwable) {
  
          StringBuffer buf = new StringBuffer();
          buf.append("aT('");
          buf.append(Messages.get().getBundle(m_locale).key(Messages.RPT_EXCEPTION_0));
          String exception = CmsEncoder.escapeXml(CmsException.getStackTraceAsString(throwable));
          StringBuffer excBuffer = new StringBuffer(exception.length() + 50);
          StringTokenizer tok = new StringTokenizer(exception, "\r\n");
          while (tok.hasMoreTokens()) {
              excBuffer.append(tok.nextToken());
              excBuffer.append(CmsHtmlReport.LINEBREAK);
          }
          buf.append(CmsStringUtil.escapeJavaScript(excBuffer.toString()));
          buf.append("'); ");
          return buf.toString();
      }
docs: Generates the formatted output for an exception.<P>
  
  @param throwable the exception
  
  @return the formatted output