Exception: ViewModel::WrappedExceptionError
- Inherits:
-
AbstractError
- Object
- StandardError
- AbstractError
- ViewModel::WrappedExceptionError
- Defined in:
- lib/view_model/error.rb
Overview
Error type to wrap an arbitrary exception as a renderable ViewModel::AbstractError
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #code ⇒ Object
- #detail ⇒ Object
-
#initialize(exception, status, code) ⇒ WrappedExceptionError
constructor
A new instance of WrappedExceptionError.
Methods inherited from AbstractError
#aggregation?, #causes, #meta, #title, #to_s, #view
Constructor Details
#initialize(exception, status, code) ⇒ WrappedExceptionError
Returns a new instance of WrappedExceptionError.
164 165 166 167 168 169 |
# File 'lib/view_model/error.rb', line 164 def initialize(exception, status, code) @exception = exception @status = status @code = code super() end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
162 163 164 |
# File 'lib/view_model/error.rb', line 162 def exception @exception end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
162 163 164 |
# File 'lib/view_model/error.rb', line 162 def status @status end |
Instance Method Details
#code ⇒ Object
175 176 177 |
# File 'lib/view_model/error.rb', line 175 def code @code || "Exception.#{exception.class.name}" end |
#detail ⇒ Object
171 172 173 |
# File 'lib/view_model/error.rb', line 171 def detail exception. end |