rollbar 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7601f7e94acde264cb7c32f5ab7360a8f1b60316
4
- data.tar.gz: 54c7075daf5c090a9cf143f7795931f4744a5e2c
3
+ metadata.gz: e9493d3e9cc3010a83a29d4f9557427033205990
4
+ data.tar.gz: 4428dd3601a7caa1e03d1ef9c69b06b024646642
5
5
  SHA512:
6
- metadata.gz: c9b0da8ae42a915de193b95d63f9e3e60325af0aa799c060dc0453258e602ee3b1330552a68429237bee75c5c6bf18b442623bb53a6efd74a394675d8c7cf7d2
7
- data.tar.gz: 2d360c8176626f5a7fb15cfbf8d6ec48801b68970c4304afc898f6ea8fec785d128e347be2988814c481c4c57f65dc8b6f337322533ccd10b98a9afc87128a6a
6
+ metadata.gz: fc0e09305ff42a01f654ddb8b89762a5d0466adf0a34d2a179ec0332ccf28ab8dda8deae16d3932fdb075714f4ce469aa8a53d9af78d08284335e259fd9314ec
7
+ data.tar.gz: 703b39ce8494345fbfd88c2268a4042dd24df9364b0f920289e1314f2cc192098d5ad36b067b967e42b4a0529eebd80254792c5535a46a7150be0174a7f4d226
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.2.9
4
+
5
+ Bug fixes:
6
+
7
+ - Fix issue causing request and person data to not be collected for RoutingErrors. See [#178](https://github.com/rollbar/rollbar-gem/pull/178)
8
+
9
+
3
10
  ## 1.2.8
4
11
 
5
12
  New features:
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v1.2.8)](https://travis-ci.org/rollbar/rollbar-gem/branches)
1
+ # Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v1.2.9)](https://travis-ci.org/rollbar/rollbar-gem/branches)
2
2
 
3
3
  <!-- RemoveNext -->
4
4
  Ruby gem for reporting exceptions, errors, and log messages to [Rollbar](https://rollbar.com).
@@ -9,7 +9,7 @@ Ruby gem for reporting exceptions, errors, and log messages to [Rollbar](https:/
9
9
 
10
10
  Add this line to your application's Gemfile:
11
11
 
12
- gem 'rollbar', '~> 1.2.8'
12
+ gem 'rollbar', '~> 1.2.9'
13
13
 
14
14
  And then execute:
15
15
 
@@ -1,7 +1,8 @@
1
1
  module Rollbar
2
2
  module ExceptionReporter
3
3
  def report_exception_to_rollbar(env, exception)
4
- Rollbar.log_debug "[Rollbar] Reporting exception: #{exception.try(:message)}"
4
+ exception_message = exception.respond_to?(:message) ? exception.message : 'No Exception Message'
5
+ Rollbar.log_debug "[Rollbar] Reporting exception: #{exception_message}"
5
6
 
6
7
  exception_data = Rollbar.log(Rollbar.configuration.uncaught_exception_level, exception)
7
8
 
@@ -15,7 +15,9 @@ module Rollbar
15
15
  def call(env)
16
16
  Rollbar.reset_notifier!
17
17
 
18
- Rollbar.scoped(fetch_scope(env)) do
18
+ env['rollbar.scope'] = scope = fetch_scope(env)
19
+
20
+ Rollbar.scoped(scope) do
19
21
  begin
20
22
  response = @app.call(env)
21
23
 
@@ -6,10 +6,15 @@ module Rollbar
6
6
 
7
7
  def render_exception_with_rollbar(env, exception)
8
8
  key = 'action_dispatch.show_detailed_exceptions'
9
- if exception.is_a? ActionController::RoutingError and env[key]
10
- report_exception_to_rollbar(env, exception)
9
+
10
+ if exception.is_a?(ActionController::RoutingError) && env[key]
11
+ scope = extract_scope_from(env)
12
+
13
+ Rollbar.scoped(scope) do
14
+ report_exception_to_rollbar(env, exception)
15
+ end
11
16
  end
12
-
17
+
13
18
  render_exception_without_rollbar(env, exception)
14
19
  end
15
20
 
@@ -17,10 +22,22 @@ module Rollbar
17
22
  call_without_rollbar(env)
18
23
  rescue ActionController::RoutingError => exception
19
24
  # won't reach here if show_detailed_exceptions is true
20
- report_exception_to_rollbar(env, exception)
25
+ scope = extract_scope_from(env)
26
+
27
+ Rollbar.scoped(scope) do
28
+ report_exception_to_rollbar(env, exception)
29
+ end
30
+
21
31
  raise exception
22
32
  end
23
33
 
34
+ def extract_scope_from(env)
35
+ scope = env['rollbar.scope']
36
+ Rollbar.log_warn('[Rollbar] rollbar.scope key has being removed from Rack env.') unless scope
37
+
38
+ scope || {}
39
+ end
40
+
24
41
  def self.included(base)
25
42
  base.send(:alias_method_chain, :call, :rollbar)
26
43
  base.send(:alias_method_chain, :render_exception, :rollbar)
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "1.2.8"
2
+ VERSION = "1.2.9"
3
3
  end
@@ -330,6 +330,15 @@ describe HomeController do
330
330
  end
331
331
  end
332
332
 
333
+ context 'with routing errors', :type => :request do
334
+ it 'raises a RoutingError exception' do
335
+ expect { get '/foo/bar', :foo => :bar }.to raise_exception
336
+
337
+ report = Rollbar.last_report
338
+ expect(report[:request][:params]['foo']).to be_eql('bar')
339
+ end
340
+ end
341
+
333
342
  after(:each) do
334
343
  Rollbar.configure do |config|
335
344
  config.logger = ::Rails.logger
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-13 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json