Class: Appsignal::Rack::JSExceptionCatcher
- Inherits:
-
Object
- Object
- Appsignal::Rack::JSExceptionCatcher
- Defined in:
- lib/appsignal/rack/js_exception_catcher.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ JSExceptionCatcher
constructor
A new instance of JSExceptionCatcher.
Constructor Details
#initialize(app, options = {}) ⇒ JSExceptionCatcher
Returns a new instance of JSExceptionCatcher.
4 5 6 7 |
# File 'lib/appsignal/rack/js_exception_catcher.rb', line 4 def initialize(app, = {}) Appsignal.logger.debug 'Initializing Appsignal::Rack::JSExceptionCatcher' @app, @options = app, end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/appsignal/rack/js_exception_catcher.rb', line 9 def call(env) if env['PATH_INFO'] == Appsignal.config[:frontend_error_catching_path] body = JSON.parse(env['rack.input'].read) transaction = JSExceptionTransaction.new(body) transaction.complete! return [ 200, {}, []] else @app.call(env) end end |