Module: Card::Format::Error
- Included in:
- Card::Format
- Defined in:
- lib/card/format/error.rb
Instance Method Summary collapse
- #debug_error(e) ⇒ Object
- #error_cardname ⇒ Object
- #rendering_error(_exception, view) ⇒ Object
- #rescue_view(e, view) ⇒ Object
Instance Method Details
#debug_error(e) ⇒ Object
11 12 13 14 |
# File 'lib/card/format/error.rb', line 11 def debug_error e debug = Card[:debugger] raise e if debug && debug.content == "on" end |
#error_cardname ⇒ Object
16 17 18 |
# File 'lib/card/format/error.rb', line 16 def error_cardname card && card.name.present? ? card.name : "unknown card" end |
#rendering_error(_exception, view) ⇒ Object
20 21 22 |
# File 'lib/card/format/error.rb', line 20 def rendering_error _exception, view "Error rendering: #{error_cardname} (#{view} view)" end |
#rescue_view(e, view) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/card/format/error.rb', line 4 def rescue_view e, view raise e if Rails.env =~ /^cucumber|test$/ error_view = Card::Error.exception_view @card, e # TODO: consider rendering dynamic error view here. rendering_error e, view end |