Class: XExceptionResponse
- Defined in:
- lib/rails-extjs-direct/xexception.rb
Overview
XExceptionResponse A special extension of XResponse for returning responses where an Exception was raised. includes a back-trace in the response which should probably be turned on with a debug switch only.
Instance Attribute Summary collapse
-
#where ⇒ Object
Returns the value of attribute where.
Attributes inherited from XResponse
#errors, #message, #result, #status, #success, #tid, #type
Instance Method Summary collapse
-
#initialize(req, e) ⇒ XExceptionResponse
constructor
initialize.
- #to_h ⇒ Object
Methods inherited from XResponse
Constructor Details
#initialize(req, e) ⇒ XExceptionResponse
initialize
23 24 25 26 27 28 |
# File 'lib/rails-extjs-direct/xexception.rb', line 23 def initialize(req, e) super(req) @type = 'exception' @message = e. @where = e.backtrace end |
Instance Attribute Details
#where ⇒ Object
Returns the value of attribute where.
16 17 18 |
# File 'lib/rails-extjs-direct/xexception.rb', line 16 def where @where end |
Instance Method Details
#to_h ⇒ Object
30 31 32 33 34 35 |
# File 'lib/rails-extjs-direct/xexception.rb', line 30 def to_h data = super data[:type] = 'exception' data[:where] = @where.join("\n") data end |