binding.put("result", this);
binding.put("session", Scope.Session.current());
binding.put("request", Http.Request.current());
binding.put("flash", Scope.Flash.current());
binding.put("params", Scope.Params.current());
binding.put("yalp", new Yalp());
String errorHtml = getMessage();
try {
errorHtml = TemplateLoader.load("errors/" + this.status + "." + (format == null ? "html" : format)).render(binding);
} catch (Exception e) {
Logger.warn(e, "Error page caused an error");