Module: Rollday::RollbarHelper
- Included in:
- Middleware
- Defined in:
- lib/rollday/rollbar_helper.rb
Instance Method Summary collapse
Instance Method Details
#rollbar_level(result) ⇒ Object
8 9 10 11 |
# File 'lib/rollday/rollbar_helper.rb', line 8 def (result) level = Rollday.config. level.is_a?(Proc) ? level.(result.status) : level end |
#rollbar_message(result) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/rollday/rollbar_helper.rb', line 13 def (result) params = [result.status, result.reason_phrase, result.body, URI(result.env.url).path, URI(result.env.url).host] = Rollday.config..(*params) return unless Rollday.config. error_klass = Rollday.config.exception_class.(*params) error_klass.new() end |
#rollbar_scope(result) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rollday/rollbar_helper.rb', line 22 def (result) { framework: "Faraday: #{::Faraday::VERSION}; Rollday: #{Rollday::VERSION}", host: URI(result.env.url).host, method: result.env.method, params: params_scope(result), path: URI(result.env.url).path, body: result.body, person: person_scope, query: query_scope(result), status: result.status, status_phrase: result.reason_phrase, } end |