code: public static ServletErrorReport constructErrorReport(Throwable th, String path) {
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
              logger.logp(Level.FINE, CLASS_NAME,"constructErrorReport", "constructing error report for path -->" + path + " Throwable -->" + th);
          }
  
          WebAppErrorReport r = new WebAppErrorReport(th);
          r.setTargetServletName(path);
  
          Throwable rootCause = th;
          while (rootCause.getCause() != null) {
              rootCause = rootCause.getCause();
          }
          if (WCCustomProperties.SERVLET_30_FNF_BEHAVIOR&&rootCause instanceof IncludeFileNotFoundException) {
              r.setErrorCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
          }
          else if (rootCause instanceof FileNotFoundException) {
              r.setErrorCode(HttpServletResponse.SC_NOT_FOUND);
          }
          else if (rootCause instanceof UnavailableException) {
              UnavailableException ue = (UnavailableException) rootCause;
              if (ue.isPermanent()) {
                  r.setErrorCode(HttpServletResponse.SC_NOT_FOUND);
              } else {
                  r.setErrorCode(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
              }
          }
          else {
              r.setErrorCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
          }
  
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
              logger.logp(Level.FINE, CLASS_NAME,"constructErrorReport", "returning new servlet error report");
          }
  
          return r;
      }
docs: begin  PK10057