rollbar 1.2.8 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +2 -2
- data/lib/rollbar/exception_reporter.rb +2 -1
- data/lib/rollbar/middleware/rails/rollbar.rb +3 -1
- data/lib/rollbar/middleware/rails/show_exceptions.rb +21 -4
- data/lib/rollbar/version.rb +1 -1
- data/spec/controllers/home_controller_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9493d3e9cc3010a83a29d4f9557427033205990
|
4
|
+
data.tar.gz: 4428dd3601a7caa1e03d1ef9c69b06b024646642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc0e09305ff42a01f654ddb8b89762a5d0466adf0a34d2a179ec0332ccf28ab8dda8deae16d3932fdb075714f4ce469aa8a53d9af78d08284335e259fd9314ec
|
7
|
+
data.tar.gz: 703b39ce8494345fbfd88c2268a4042dd24df9364b0f920289e1314f2cc192098d5ad36b067b967e42b4a0529eebd80254792c5535a46a7150be0174a7f4d226
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rollbar notifier for Ruby [](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.
|
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
|
-
|
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
|
|
@@ -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
|
-
|
10
|
-
|
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
|
-
|
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)
|
data/lib/rollbar/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|