Method: Waw::ErrorHandler::Backtrace#ex_to_html

Defined in:
lib/waw/controllers/error/backtrace.rb

#ex_to_html(ex, backtrace) ⇒ Object

Converts an exception to a friendly HTML chunck



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/waw/controllers/error/backtrace.rb', line 12

def ex_to_html(ex, backtrace)
  "    <html>\n      <head>\n        <style type=\"text/css\">\n          body {\n            font-size: 14px;\n            font-family: \"Courier\", \"Arial\", sans-serif;\n          }\n          p.message {\n            font-size: 16px;\n            font-weight: bold;\n          }\n        </style>\n      </head>\n      <body>\n        <h1>Internal server error (ruby exception)</h1>\n        <p class=\"message\"><code>\#{CGI.escapeHTML(ex.message)}</code></p>\n        <div style=\"margin-left:50px;\">\n          \#{ex_backtrace_to_html(backtrace)}\n        </div>\n      </body>\n    </html>\n  EOF\nend\n"