@import play.templates.JavaExtensions, play.Play, play.utils.Utils, play.exceptions.* @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())

@// [workaround] https://play.lighthouseapp.com/projects/57987-play-framework/tickets/1580-playexceptionscacheexception-should-implement-sourceattachment @{ final List source = (exception instanceof CacheException) ? ((CacheException)exception).getSource() : ((SourceAttachment)exception).getSource(); int lineNumber = (exception instanceof CacheException) ? ((CacheException)exception).getLineNumber() : ((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())

}