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.
162 163 164 165 166 167 |
# File 'lib/view_model/error.rb', line 162 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.
160 161 162 |
# File 'lib/view_model/error.rb', line 160 def exception @exception end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
160 161 162 |
# File 'lib/view_model/error.rb', line 160 def status @status end |
Instance Method Details
#code ⇒ Object
173 174 175 |
# File 'lib/view_model/error.rb', line 173 def code @code || "Exception.#{exception.class.name}" end |
#detail ⇒ Object
169 170 171 |
# File 'lib/view_model/error.rb', line 169 def detail exception. end |