Sha256: 0eca5c5d8622a6b4eab123105753321a23bea5bc298f84fbfb32b70030010c24
Contents?: true
Size: 827 Bytes
Versions: 5
Compression:
Stored size: 827 Bytes
Contents
module Appsignal module Rack class JSExceptionCatcher def initialize(app, options = {}) Appsignal.logger.debug "Initializing Appsignal::Rack::JSExceptionCatcher" @app = app @options = options end def call(env) if env["PATH_INFO"] == Appsignal.config[:frontend_error_catching_path] body = JSON.parse(env["rack.input"].read) if body["name"].is_a?(String) && !body["name"].empty? transaction = JSExceptionTransaction.new(body) transaction.complete! code = 200 else Appsignal.logger.debug "JSExceptionCatcher: Could not send exception, 'name' is empty." code = 422 end [code, {}, []] else @app.call(env) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems