rollbar 3.5.1 → 3.6.1
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/.rubocop.yml +2 -4
- data/Gemfile +4 -0
- data/gemfiles/rails50.gemfile +3 -1
- data/gemfiles/rails51.gemfile +1 -0
- data/gemfiles/rails52.gemfile +1 -0
- data/gemfiles/rails60.gemfile +1 -0
- data/gemfiles/rails61.gemfile +1 -0
- data/gemfiles/rails70.gemfile +1 -0
- data/lib/rollbar/configuration.rb +16 -0
- data/lib/rollbar/exception_reporter.rb +2 -1
- data/lib/rollbar/logger.rb +3 -21
- data/lib/rollbar/notifier.rb +0 -1
- data/lib/rollbar/plugins/active_job.rb +33 -33
- data/lib/rollbar/plugins/rails/error_subscriber.rb +12 -0
- data/lib/rollbar/plugins/rails.rb +8 -0
- data/lib/rollbar/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31f15586920ecb703867f190757c35491671f3391ed2b9c02f281809f71b10f4
|
4
|
+
data.tar.gz: c96de5c4519b77662362395c4a50750fc25803fc10fbde5eecfebda6fefe6688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc7101d46b693662e8cd1ecce2408176f13f8a770eb4d2af3ff984041728c6158f18c1b362a3c096b95384c6c6493e014d2c6196048b3cb433710c34b579d77
|
7
|
+
data.tar.gz: 9440cb71e6cad634faa99e4ea2bdce6f2eba5b0169920c61e17d4c5cbc17eae8e9b9da45113d79cdb943ea842613fa4f3259f8150977bf2373d35586b91fc8ad
|
data/.rubocop.yml
CHANGED
@@ -65,9 +65,9 @@ Style/FrozenStringLiteralComment:
|
|
65
65
|
Enabled: false
|
66
66
|
|
67
67
|
Style/HashSyntax:
|
68
|
-
EnforcedStyle:
|
68
|
+
EnforcedStyle: no_mixed_keys
|
69
69
|
SupportedStyles:
|
70
|
-
-
|
70
|
+
- no_mixed_keys
|
71
71
|
|
72
72
|
Style/Lambda:
|
73
73
|
Enabled: false
|
@@ -156,8 +156,6 @@ Performance/InefficientHashSearch:
|
|
156
156
|
|
157
157
|
Performance/OpenStruct:
|
158
158
|
Enabled: true
|
159
|
-
Exclude:
|
160
|
-
- spec/**/*
|
161
159
|
|
162
160
|
Performance/RangeInclude:
|
163
161
|
Enabled: true
|
data/Gemfile
CHANGED
data/gemfiles/rails50.gemfile
CHANGED
@@ -34,13 +34,15 @@ gem 'sucker_punch', '~> 2.0'
|
|
34
34
|
|
35
35
|
gem 'rack', '2.1.2' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
|
36
36
|
|
37
|
-
|
37
|
+
gem 'concurrent-ruby', '1.3.4'
|
38
38
|
gem 'database_cleaner', '~> 1.8.4'
|
39
39
|
gem 'delayed_job', :require => false
|
40
40
|
gem 'generator_spec'
|
41
41
|
gem 'redis', '<= 3.3.5'
|
42
42
|
gem 'resque'
|
43
43
|
gem 'secure_headers', '~> 6.3.2', :require => false
|
44
|
+
|
45
|
+
# We need last sinatra that uses rack 2.1.x
|
44
46
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag => 'v2.0.8'
|
45
47
|
|
46
48
|
unless is_jruby
|
data/gemfiles/rails51.gemfile
CHANGED
@@ -37,6 +37,7 @@ gem 'rack', '2.1.2' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
|
|
37
37
|
# We need last sinatra that uses rack 2.1.x
|
38
38
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag => 'v2.0.8'
|
39
39
|
|
40
|
+
gem 'concurrent-ruby', '1.3.4'
|
40
41
|
gem 'database_cleaner', '~> 1.8.4'
|
41
42
|
gem 'delayed_job', :require => false
|
42
43
|
gem 'generator_spec'
|
data/gemfiles/rails52.gemfile
CHANGED
@@ -31,6 +31,7 @@ gem 'sucker_punch', '~> 2.0'
|
|
31
31
|
# We need last sinatra that uses rack 2.x and ruby 2.5.x
|
32
32
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
|
33
33
|
|
34
|
+
gem 'concurrent-ruby', '1.3.4'
|
34
35
|
gem 'database_cleaner'
|
35
36
|
gem 'delayed_job', :require => false
|
36
37
|
gem 'generator_spec'
|
data/gemfiles/rails60.gemfile
CHANGED
@@ -27,6 +27,7 @@ gem 'sucker_punch', '~> 2.0'
|
|
27
27
|
# We need last sinatra that uses rack 2.x and ruby 2.5.x
|
28
28
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
|
29
29
|
|
30
|
+
gem 'concurrent-ruby', '1.3.4'
|
30
31
|
gem 'database_cleaner'
|
31
32
|
gem 'delayed_job', '4.1.9', :require => false
|
32
33
|
gem 'generator_spec'
|
data/gemfiles/rails61.gemfile
CHANGED
@@ -27,6 +27,7 @@ gem 'sucker_punch', '~> 2.0'
|
|
27
27
|
# We need last sinatra that uses rack 2.x and ruby 2.5.x
|
28
28
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
|
29
29
|
|
30
|
+
gem 'concurrent-ruby', '1.3.4'
|
30
31
|
gem 'database_cleaner'
|
31
32
|
gem 'delayed_job', '4.1.9', :require => false
|
32
33
|
gem 'generator_spec'
|
data/gemfiles/rails70.gemfile
CHANGED
@@ -27,6 +27,7 @@ gem 'sucker_punch', '~> 2.0'
|
|
27
27
|
# We need last sinatra that uses rack 2.x and ruby 2.5.x
|
28
28
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
|
29
29
|
|
30
|
+
gem 'concurrent-ruby', '1.3.4'
|
30
31
|
gem 'database_cleaner'
|
31
32
|
gem 'delayed_job', '4.1.10', :require => false
|
32
33
|
gem 'generator_spec'
|
@@ -76,6 +76,7 @@ module Rollbar
|
|
76
76
|
:web_base,
|
77
77
|
:write_to_file
|
78
78
|
attr_reader :before_process,
|
79
|
+
:enable_rails_error_subscriber,
|
79
80
|
:logger_level,
|
80
81
|
:project_gem_paths,
|
81
82
|
:send_extra_frame_data,
|
@@ -104,6 +105,7 @@ module Rollbar
|
|
104
105
|
@disable_core_monkey_patch = false
|
105
106
|
@disable_rack_monkey_patch = false
|
106
107
|
@enable_error_context = true
|
108
|
+
@enable_rails_error_subscriber = false
|
107
109
|
@dj_threshold = 0
|
108
110
|
@dj_use_scoped_block = false
|
109
111
|
@async_skip_report_handler = nil
|
@@ -337,6 +339,20 @@ module Rollbar
|
|
337
339
|
@send_extra_frame_data = value
|
338
340
|
end
|
339
341
|
|
342
|
+
def enable_rails_error_subscriber=(enable)
|
343
|
+
return if !defined?(::Rails) || ::Rails.gem_version < ::Gem::Version.new('7.1.0')
|
344
|
+
|
345
|
+
if @enable_rails_error_subscriber && !enable
|
346
|
+
::Rails.error.unsubscribe(Rollbar::ErrorSubscriber)
|
347
|
+
end
|
348
|
+
|
349
|
+
if !@enable_rails_error_subscriber && enable
|
350
|
+
::Rails.error.subscribe(Rollbar::ErrorSubscriber.new)
|
351
|
+
end
|
352
|
+
|
353
|
+
@enable_rails_error_subscriber = enable
|
354
|
+
end
|
355
|
+
|
340
356
|
# allow params to be read like a hash
|
341
357
|
def [](option)
|
342
358
|
send(option)
|
@@ -27,7 +27,8 @@ module Rollbar
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def capture_uncaught?
|
30
|
-
Rollbar.configuration.capture_uncaught != false
|
30
|
+
Rollbar.configuration.capture_uncaught != false &&
|
31
|
+
!Rollbar.configuration.enable_rails_error_subscriber
|
31
32
|
end
|
32
33
|
|
33
34
|
def log_exception_message(exception)
|
data/lib/rollbar/logger.rb
CHANGED
@@ -17,12 +17,10 @@ module Rollbar
|
|
17
17
|
class Logger < ::Logger
|
18
18
|
class Error < RuntimeError; end
|
19
19
|
|
20
|
-
class DatetimeFormatNotSupported < Error; end
|
21
|
-
|
22
|
-
class FormatterNotSupported < Error; end
|
23
|
-
|
24
20
|
def initialize
|
25
|
-
|
21
|
+
super(nil)
|
22
|
+
|
23
|
+
self.level = ERROR
|
26
24
|
end
|
27
25
|
|
28
26
|
def add(severity, message = nil, progname = nil)
|
@@ -39,22 +37,6 @@ module Rollbar
|
|
39
37
|
error(message)
|
40
38
|
end
|
41
39
|
|
42
|
-
def formatter=(_)
|
43
|
-
raise(FormatterNotSupported)
|
44
|
-
end
|
45
|
-
|
46
|
-
def formatter
|
47
|
-
raise(FormatterNotSupported)
|
48
|
-
end
|
49
|
-
|
50
|
-
def datetime_format=(_)
|
51
|
-
raise(DatetimeFormatNotSupported)
|
52
|
-
end
|
53
|
-
|
54
|
-
def datetime_format
|
55
|
-
raise(DatetimeFormatNotSupported)
|
56
|
-
end
|
57
|
-
|
58
40
|
# Returns a Rollbar::Notifier instance with the current global scope and
|
59
41
|
# with a logger writing to /dev/null so we don't have a infinite loop
|
60
42
|
# when Rollbar.configuration.logger is Rails.logger.
|
data/lib/rollbar/notifier.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
Rollbar
|
2
|
-
|
3
|
-
|
1
|
+
module Rollbar
|
2
|
+
# Report any uncaught errors in a job to Rollbar and reraise
|
3
|
+
module ActiveJob
|
4
|
+
def self.included(base)
|
5
|
+
base.send :rescue_from, Exception do |exception|
|
6
|
+
job_data = {
|
7
|
+
:job => self.class.name,
|
8
|
+
:use_exception_level_filters => true
|
9
|
+
}
|
4
10
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
base.send :rescue_from, Exception do |exception|
|
11
|
-
job_data = {
|
12
|
-
:job => self.class.name,
|
13
|
-
:use_exception_level_filters => true
|
14
|
-
}
|
11
|
+
# When included in ActionMailer, the handler is called twice.
|
12
|
+
# This detects the execution that has the expected state.
|
13
|
+
if defined?(ActionMailer::Base) && self.class.ancestors.include?(ActionMailer::Base)
|
14
|
+
job_data[:action] = action_name
|
15
|
+
job_data[:params] = @params
|
15
16
|
|
16
|
-
|
17
|
-
# This detects the execution that has the expected state.
|
18
|
-
if defined?(ActionMailer::Base) && self.class.ancestors.include?(ActionMailer::Base)
|
19
|
-
job_data[:action] = action_name
|
20
|
-
job_data[:params] = @params
|
17
|
+
Rollbar.error(exception, job_data)
|
21
18
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
else
|
30
|
-
arguments
|
31
|
-
end
|
32
|
-
job_data[:job_id] = job_id if defined?(job_id)
|
33
|
-
|
34
|
-
Rollbar.error(exception, job_data)
|
19
|
+
# This detects other supported integrations.
|
20
|
+
elsif defined?(arguments)
|
21
|
+
job_data[:arguments] = \
|
22
|
+
if self.class.respond_to?(:log_arguments?) && !self.class.log_arguments?
|
23
|
+
arguments.map(&Rollbar::Scrubbers.method(:scrub_value))
|
24
|
+
else
|
25
|
+
arguments
|
35
26
|
end
|
27
|
+
job_data[:job_id] = job_id if defined?(job_id)
|
36
28
|
|
37
|
-
|
38
|
-
end
|
29
|
+
Rollbar.error(exception, job_data)
|
39
30
|
end
|
31
|
+
|
32
|
+
raise exception
|
40
33
|
end
|
41
34
|
end
|
35
|
+
end
|
36
|
+
end
|
42
37
|
|
38
|
+
Rollbar.plugins.define('active_job') do
|
39
|
+
dependency { !configuration.disable_monkey_patch }
|
40
|
+
dependency { !configuration.disable_action_mailer_monkey_patch }
|
41
|
+
|
42
|
+
execute do
|
43
43
|
if defined?(ActiveSupport) && ActiveSupport.respond_to?(:on_load)
|
44
44
|
ActiveSupport.on_load(:action_mailer) do
|
45
45
|
if defined?(ActionMailer::MailDeliveryJob) # Rails >= 6.0
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Rollbar
|
2
|
+
class ErrorSubscriber
|
3
|
+
def report(error, handled:, severity:, context:, source: nil)
|
4
|
+
# The default `nil` for capture_uncaught means `true`. so check for false.
|
5
|
+
return unless handled || Rollbar.configuration.capture_uncaught != false
|
6
|
+
|
7
|
+
extra = context.is_a?(Hash) ? context.deep_dup : {}
|
8
|
+
extra[:custom_data_method_context] = source
|
9
|
+
Rollbar.log(severity, error, extra)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -79,3 +79,11 @@ Rollbar.plugins.define('rails-rollbar.js') do
|
|
79
79
|
Rollbar::Js::Frameworks::Rails.new.load(self)
|
80
80
|
end
|
81
81
|
end
|
82
|
+
|
83
|
+
Rollbar.plugins.define('rails-error-subscriber') do
|
84
|
+
dependency { defined?(Rails::VERSION) && Rails::VERSION::MAJOR >= 7 }
|
85
|
+
|
86
|
+
execute! do
|
87
|
+
require 'rollbar/plugins/rails/error_subscriber'
|
88
|
+
end
|
89
|
+
end
|
data/lib/rollbar/version.rb
CHANGED
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: 3.
|
4
|
+
version: 3.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rollbar, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Track and debug errors in your Ruby applications with ease using Rollbar.
|
14
14
|
With this gem, you can easily monitor and report on exceptions and other errors
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/rollbar/plugins/rack.rb
|
102
102
|
- lib/rollbar/plugins/rails.rb
|
103
103
|
- lib/rollbar/plugins/rails/controller_methods.rb
|
104
|
+
- lib/rollbar/plugins/rails/error_subscriber.rb
|
104
105
|
- lib/rollbar/plugins/rails/railtie30.rb
|
105
106
|
- lib/rollbar/plugins/rails/railtie32.rb
|
106
107
|
- lib/rollbar/plugins/rails/railtie_mixin.rb
|