Sha256: 6cdb80c080a85c87d7509a26020e717064a3fd6ee3baf5f6b3c7a3cd09d7adfa

Contents?: true

Size: 721 Bytes

Versions: 3

Compression:

Stored size: 721 Bytes

Contents

module Appsignal
  module Rack
    class JSExceptionCatcher
      def initialize(app, options = {})
        Appsignal.logger.debug 'Initializing Appsignal::Rack::JSExceptionCatcher'
        @app, @options = app, options
      end

      def call(env)
        if env['PATH_INFO'] == Appsignal.config[:frontend_error_catching_path]
          if Appsignal.config.active? &&
             Appsignal.config[:enable_frontend_error_catching] == true

            body        = JSON.parse(env['rack.input'].read)
            transaction = JSExceptionTransaction.new(body)
            transaction.complete!
          end
          return [ 200, {}, []]
        else
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appsignal-0.11.8.beta.2 lib/appsignal/rack/js_exception_catcher.rb
appsignal-0.11.8.beta.1 lib/appsignal/rack/js_exception_catcher.rb
appsignal-0.11.8.beta.0 lib/appsignal/rack/js_exception_catcher.rb