-
- void writeErrorPage(PrintWriter pw, Throwable t, Locale locale) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(baos);
- FrankBundle bundle = FrankBundle.getInst(locale);
-
- pw.println("<HTML><HEAD><TITLE>" +
- bundle.get(FrankBundle.FRANK) + ": " +
- bundle.get(FrankBundle.ERROR_PAGE) +
- "</TITLE></HEAD>");
- pw.println("<BODY><H1>" +
- bundle.get(FrankBundle.FRANK) + ": " +
- bundle.get(FrankBundle.UNEXPECTED_ERROR) +
- "</H1><P><PRE>");
-
- // Note that, if we cared about security, we would log this stack trace to a
- // server log, and only report a cross-reference to the log file back to the
- // end user's browser, to avoid potentially exposing internal info that we
- // don't want to share.
- // At least at this point, we don't care (that much), and trade off a
- // potential information leak in favour of reducing our code complexity
- // and the administrator's workload.
- t.printStackTrace(ps);
- String stackTrace = baos.toString();
- pw.println(stackTrace);
-
- pw.println("</PRE></P></BODY>");
- pw.println("</HTML>");
- }
-
-