@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) {

@exception.getErrorTitle()

@if ("DEV".equals(Play.mode.name())) {

@exception.getErrorDescription()

} else if ("PROD".equals(Play.mode.name())) {

Error details are not displayed when Play! is in PROD mode. Check server logs for detail.

} @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) {
@(line_index+from) @com.greenlaw110.rythm.utils.S.escape(line).replace("↓", "").replace("\000", "").replace("\001", "")
}
} @{ String moreHtml = exception.getMoreHTML() }@ @if (null != moreHtml) {
@moreHtml
}
This exception has been logged with id @exception.getId()
} else { }