Class: Schneiderlein::FlyCatcher
- Inherits:
-
Struct
- Object
- Struct
- Schneiderlein::FlyCatcher
- Defined in:
- lib/schneiderlein/fly_catcher.rb
Constant Summary collapse
- PARSE_ERROR_CONSTANT =
if Rails.version.to_f < 5.1 ActionDispatch::ParamsParser::ParseError else ActionDispatch::Http::Parameters::ParseError end
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
3 4 5 |
# File 'lib/schneiderlein/fly_catcher.rb', line 3 def app @app end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/schneiderlein/fly_catcher.rb', line 12 def call(env) app.call(env) rescue PARSE_ERROR_CONSTANT => e env['rack.schneiderlein.parse_errors'] ||= [] env['rack.schneiderlein.parse_errors'] << e app.call(remove_errors_from(env)) end |