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.



49
50
51
52
53
54
55
56
# File 'lib/wee/response.rb', line 49

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