@import play.templates.JavaExtensions, play.Play, play.utils.Utils, play.exceptions.SourceAttachment; @args play.exceptions.PlayException exception; @verbatim { } @// verbatim @if (exception instanceof play.exceptions.PlayException) { @if (exception.isSourceAvailable() && (null != exception.getLineNumber()) && "DEV".equals(Play.mode.name())) {

In @exception.getSourceFile() (around line @exception.getLineNumber())

@{ final List source = ((SourceAttachment)exception).getSource(); int lineNumber = ((SourceAttachment)exception).getLineNumber(); final int from = lineNumber - 5 >= 0 && lineNumber < source.size() ? lineNumber - 5 : 0; final int to = lineNumber + 5 < source.size() ? lineNumber + 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) { @(null != Utils.open(exception.getSourceFile(), line_index+from) ? ("") : "")
@(line_index+from):
 @com.greenlaw110.rythm.utils.S.escape(line).replace("↓", "").replace("\000", "").replace("\001", "")
@(null == Utils.open(exception.getSourceFile(), line_index+from) ? "
" : "") }
} @{ String moreHtml = exception.getMoreHTML() }@ @if (null != moreHtml) {
@moreHtml
}
This exception has been logged with id @exception.getId()
} else { }