@import play.templates.JavaExtensions, play.Play, play.utils.Utils, play.exceptions.SourceAttachment @args play.exceptions.PlayException exception
@if (exception instanceof play.exceptions.PlayException) {

# @exception.getErrorTitle()

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

@exception.getErrorDescription().raw()

} 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).toString().replace("↓", "↓").replace("\000", "").replace("\001", "").raw()

}
} @{ String moreHtml = exception.getMoreHTML() }@ @if (null != moreHtml) {
@moreHtml
}
This exception has been logged with id @exception.getId()
} else {

# @(null == exception.getMessage() ? "" : exception.getMessage())

}