Class: Hanami::Middleware::RenderErrors::RenderableException Private
- Inherits:
-
Object
- Object
- Hanami::Middleware::RenderErrors::RenderableException
- Defined in:
- lib/hanami/middleware/render_errors.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #exception ⇒ Object readonly private
- #responses ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(exception, responses:) ⇒ RenderableException
constructor
private
A new instance of RenderableException.
- #rescue_response? ⇒ Boolean private
- #status_code ⇒ Object private
Constructor Details
#initialize(exception, responses:) ⇒ RenderableException
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RenderableException.
28 29 30 31 |
# File 'lib/hanami/middleware/render_errors.rb', line 28 def initialize(exception, responses:) @exception = exception @responses = responses end |
Instance Attribute Details
#exception ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/hanami/middleware/render_errors.rb', line 23 def exception @exception end |
#responses ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/hanami/middleware/render_errors.rb', line 24 def responses @responses end |
Instance Method Details
#rescue_response? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/hanami/middleware/render_errors.rb', line 35 def rescue_response? responses.key?(exception.class.name) end |
#status_code ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/hanami/middleware/render_errors.rb', line 41 def status_code Rack::Utils.status_code(responses[exception.class.name]) end |