Exception: Straides::ReturnHttpCodeError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Straides::ReturnHttpCodeError
- Defined in:
- lib/straides/return_http_code_error.rb
Overview
A custom exception for bubbling up HTTP errors and showing the corresponding error pages.
Instance Attribute Summary collapse
-
#render_options ⇒ Object
Returns the value of attribute render_options.
Instance Method Summary collapse
-
#has_template? ⇒ true, false
Checks if error options contain any templates assigned to it.
-
#initialize(render_options = {}) ⇒ ReturnHttpCodeError
constructor
A new instance of ReturnHttpCodeError.
Constructor Details
#initialize(render_options = {}) ⇒ ReturnHttpCodeError
Returns a new instance of ReturnHttpCodeError.
11 12 13 |
# File 'lib/straides/return_http_code_error.rb', line 11 def initialize( = {}) @render_options = end |
Instance Attribute Details
#render_options ⇒ Object
Returns the value of attribute render_options.
6 7 8 |
# File 'lib/straides/return_http_code_error.rb', line 6 def @render_options end |
Instance Method Details
#has_template? ⇒ true, false
Checks if error options contain any templates assigned to it.
18 19 20 |
# File 'lib/straides/return_http_code_error.rb', line 18 def has_template? (.keys & [:file, :text, :json, :nothing]).any? end |