Class: Wee::ErrorResponse
Constant Summary
Constants inherited from Response
Instance Attribute Summary
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(exception) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #render(c) ⇒ Object
Methods inherited from Response
#<<, #content_type, #content_type=, #cookies, #cookies?
Constructor Details
#initialize(exception) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
71 72 73 74 75 |
# File 'lib/wee/response.rb', line 71 def initialize(exception) super('text/html', '') @exception = exception render(@content) end |
Instance Method Details
#render(c) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/wee/response.rb', line 77 def render(c) c << "<html><head><title>Error occured</title></head><body>" c << "<p>#{ @exception }" c << @exception.backtrace.join("<br/>") c << "</p>" c << "</body></html>" end |