Class: Bizside::ShowExceptions
- Inherits:
-
Object
- Object
- Bizside::ShowExceptions
- Defined in:
- lib/bizside/show_exceptions.rb
Constant Summary collapse
- BIZSIDE_EXCEPTION_ENV_KEY =
'bizside.exception'
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ShowExceptions
constructor
A new instance of ShowExceptions.
Constructor Details
#initialize(app) ⇒ ShowExceptions
Returns a new instance of ShowExceptions.
6 7 8 |
# File 'lib/bizside/show_exceptions.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/bizside/show_exceptions.rb', line 10 def call(env) @app.call(env) rescue Exception => exception env[BIZSIDE_EXCEPTION_ENV_KEY] = exception # 発生した例外を保持 raise exception end |