code: public static String getFormattedErrorstack(Throwable t) {
  
          String stacktrace = CmsException.getStackTraceAsString(t);
          if (CmsStringUtil.isEmpty(stacktrace)) {
              return "";
          } else {
              stacktrace = CmsStringUtil.escapeJavaScript(stacktrace);
              stacktrace = CmsEncoder.escapeXml(stacktrace);
              StringBuffer result = new StringBuffer(256);
              result.append(
                  "<html><body style='background-color: /*begin-color Window*/#ffffff/*end-color*/; overflow: scroll;'><pre>");
              result.append(stacktrace);
              result.append("</pre></body></html>");
              return result.toString();
          }
      }
docs: Returns the HTML formatted error stack of a Throwable.<p>
  
  The error stack is used by the common error screen
  that is displayed if an error occurs.<p>
  
  @param t the throwable to get the errorstack from
  @return the formatted value of the errorstack parameter