%
nice_source = req.error.backtrace[0].match(/^(.+?):(\d+)(|:in `(.+)')$/)
file = nice_source[1].gsub(File.expand_path(Config.app.root) + '/', '')
line = nice_source[2]
msg = CGI.escapeHTML("#{req.error.class}: #{req.error}")
trace = req.error.backtrace.map { |bt| CGI.escapeHTML(bt) }.join('
')
%>
The error originated on line <%=line%> of <%=file%>
.
<%=trace%>