@import org.rythmengine.exception.* @import org.rythmengine.spring.web.* @args Exception exception @{ org.rythmengine.RythmEngine _rythm = __engine(); StackTraceElement head = RythmExceptionHandler.Util.head(exception); List tail = RythmExceptionHandler.Util.tail(exception); } @if (exception instanceof RythmException) { @{final RythmException rex = (RythmException)exception}

@rex.errorTitle()

@rex.errorDesc().raw()

@{ String tmpl = rex.getTemplateName(); int errLineNo = rex.templateLineNumber; }

In @tmpl (around line @errLineNo)

@{ final List source = Arrays.asList(rex.templateSource.split("\n")); final int from = errLineNo - 5 >= 0 && errLineNo < source.size() ? errLineNo - 5 : 0; final int to = errLineNo + 5 < source.size() ? errLineNo + 5 : source.size()-1; final List lines = new ArrayList(); for (int i = from; i <= to; ++i) { lines.add(source.get(i)); } } @for (String line: lines) { @//line_index + @from | @rex.templateLineNumber
@(line_index+from) @org.rythmengine.utils.S.escapeXml(line).toString().replace("↓", "").replace("\000", "").replace("\001", "").raw()
}
} else {
The full stack trace of the root cause is available in the server logs...
}