Class: RestfulError::ExceptionsApp
- Inherits:
-
Object
- Object
- RestfulError::ExceptionsApp
- Defined in:
- lib/restful_error/exceptions_app.rb
Defined Under Namespace
Classes: Config
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(config = self.class.config) ⇒ ExceptionsApp
constructor
A new instance of ExceptionsApp.
Constructor Details
#initialize(config = self.class.config) ⇒ ExceptionsApp
Returns a new instance of ExceptionsApp.
14 15 16 |
# File 'lib/restful_error/exceptions_app.rb', line 14 def initialize(config = self.class.config) @config = config end |
Class Method Details
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/restful_error/exceptions_app.rb', line 17 def call(env) app.call(env) rescue Exception => _e raise unless @config.fallback @config.fallback.call(env) end |