Sha256: 67f0dae3afc61e78795bbed9dc9cedcdde4a4d57b00aab78782ea5149e8f5200
Contents?: true
Size: 829 Bytes
Versions: 12
Compression:
Stored size: 829 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] body = JSON.parse(env['rack.input'].read) if body['name'].is_a?(String) && body['name'].length > 0 transaction = JSExceptionTransaction.new(body) transaction.complete! code = 200 else Appsignal.logger.debug "JSExceptionCatcher: Could not send exception, 'name' is empty." code = 422 end return [code, {}, []] else @app.call(env) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems