write("<h2>Error in application " + app.getName() + "</h2><p>");
encode(getErrorMessage(throwable));
writeln("</p>");
if (app.debug()) {
if (throwable instanceof ScriptingException) {
ScriptingException scriptx = (ScriptingException) throwable;
writeln("<h4>Script Stack</h4>");
writeln("<pre>" + scriptx.getScriptStackTrace() + "</pre>");
writeln("<h4>Java Stack</h4>");
writeln("<pre>" + scriptx.getJavaStackTrace() + "</pre>");
} else {
writeln("<h4>Java Stack</h4>");
writeln("<pre>");
throwable.printStackTrace(new PrintWriter(this));
writeln("</pre>");