Class: Wee::ErrorResponse

Inherits:
Response show all
Includes:
Rack::Utils
Defined in:
lib/wee/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



58
59
60
61
62
63
64
65
# File 'lib/wee/response.rb', line 58

def initialize(exception)
  super()
  self << "<html><head><title>Error occured</title></head><body>"
  self << "<p>#{ escape_html(@exception.inspect) }<br/>"
  self << exception.backtrace.map{|s| escape_html(s)}.join("<br/>") 
  self << "</p>"
  self << "</body></html>"
end