method
error
v2_6_3 -
Show latest stable
- Class:
RDoc::Servlet
error(exception, req, res)public
Generates an error page for the exception while handling req on res.
# File lib/rdoc/servlet.rb, line 195
def error exception, req, res
backtrace = exception.backtrace.join "\n"
res.content_type = 'text/html'
res.status = 500
res.body = <!DOCTYPE html><html><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><title>Error - #{ERB::Util.html_escape exception.class}</title><link type="text/css" media="screen" href="#{@mount_path}/css/rdoc.css" rel="stylesheet"></head><body><h1>Error</h1><p>While processing <code>#{ERB::Util.html_escape req.request_uri}</code> theRDoc (#{ERB::Util.html_escape RDoc::VERSION}) server has encountered a<code>#{ERB::Util.html_escape exception.class}</code>exception:<pre>#{ERB::Util.html_escape exception.message}</pre><p>Please report this to the<a href="https://github.com/ruby/rdoc/issues">RDoc issues tracker</a>. Pleaseinclude the RDoc version, the URI above and exception class, message andbacktrace. If you're viewing a gem's documentation, include the gem name andversion. If you're viewing Ruby's documentation, include the version of ruby.<p>Backtrace:<pre>#{ERB::Util.html_escape backtrace}</pre></body></html>
end