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.
10 11 12 |
# File 'lib/straides/return_http_code_error.rb', line 10 def initialize( = {}) @render_options = end |
Instance Attribute Details
#render_options ⇒ Object
Returns the value of attribute render_options.
5 6 7 |
# File 'lib/straides/return_http_code_error.rb', line 5 def @render_options end |
Instance Method Details
#has_template? ⇒ true, false
Checks if error options contain any templates assigned to it.
17 18 19 |
# File 'lib/straides/return_http_code_error.rb', line 17 def has_template? (.keys & [:file, :text, :json, :nothing]).any? end |