rollbar 3.6.2 → 3.7.0
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/.github/workflows/ci.yml +11 -5
- data/Gemfile +15 -12
- data/README.md +1 -2
- data/gemfiles/rails72.gemfile +52 -0
- data/gemfiles/rails81.gemfile +52 -0
- data/lib/rollbar/exception_reporter.rb +6 -2
- data/lib/rollbar/item.rb +7 -1
- data/lib/rollbar/middleware/js.rb +2 -2
- data/lib/rollbar/notifier.rb +30 -21
- data/lib/rollbar/plugins/rails/controller_methods.rb +22 -25
- data/lib/rollbar/plugins/rails/error_subscriber.rb +7 -0
- data/lib/rollbar/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b912ffafc26e12fa05ae5fa8aa0543c076795aae6775c28061416eeffc6335b1
|
|
4
|
+
data.tar.gz: dbc4de76c4015fb4bc61a28974093581e9cc05d1657569bae228ce86866307ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a59886a94987e0a91c5e7a707a14835063cf60c04d5283861e83d65a99d21d3b706ded86918ab8433b6d88bba268f015ca84568d81cf6f94664fed660c0c680
|
|
7
|
+
data.tar.gz: a586f49787c746587b7a917879b901fc9137cc3efeed7b1a7316c48800455a4efc0f77a4cb6859e0d3380ce79e9f0ee57151910edbfee6506f0fda26e20b3d42
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
runs-on: ubuntu-22.04
|
|
12
12
|
strategy:
|
|
13
13
|
matrix:
|
|
14
|
-
ruby-version: [2.5.
|
|
14
|
+
ruby-version: [2.5.9, 2.6.0, 2.6.10, 2.7.8]
|
|
15
15
|
gemfile:
|
|
16
16
|
- gemfiles/rails50.gemfile
|
|
17
17
|
- gemfiles/rails51.gemfile
|
|
@@ -19,12 +19,18 @@ jobs:
|
|
|
19
19
|
- gemfiles/rails60.gemfile
|
|
20
20
|
- gemfiles/rails61.gemfile
|
|
21
21
|
include:
|
|
22
|
+
- gemfile: gemfiles/rails81.gemfile
|
|
23
|
+
ruby-version: 3.4.7
|
|
24
|
+
- gemfile: gemfiles/rails81.gemfile
|
|
25
|
+
ruby-version: 3.3.10
|
|
26
|
+
- gemfile: gemfiles/rails72.gemfile
|
|
27
|
+
ruby-version: 3.4.7
|
|
28
|
+
- gemfile: gemfiles/rails72.gemfile
|
|
29
|
+
ruby-version: 3.3.10
|
|
22
30
|
- gemfile: gemfiles/rails71.gemfile
|
|
23
|
-
ruby-version: 3.4.
|
|
31
|
+
ruby-version: 3.4.7
|
|
24
32
|
- gemfile: gemfiles/rails71.gemfile
|
|
25
|
-
ruby-version: 3.
|
|
26
|
-
- gemfile: gemfiles/rails71.gemfile
|
|
27
|
-
ruby-version: 3.1.1
|
|
33
|
+
ruby-version: 3.3.10
|
|
28
34
|
- gemfile: gemfiles/rails70.gemfile
|
|
29
35
|
ruby-version: 3.1.1
|
|
30
36
|
- gemfile: gemfiles/rails70.gemfile
|
data/Gemfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This Gemfile is compatible with Ruby 2.5.0 or greater. To test with
|
|
2
2
|
# earlier Rubies, use the appropriate Gemfile from the ./gemfiles/ dir.
|
|
3
|
-
ruby '3.4.
|
|
3
|
+
ruby '3.4.7'
|
|
4
4
|
|
|
5
5
|
source 'https://rubygems.org'
|
|
6
6
|
|
|
@@ -13,28 +13,31 @@ ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
|
13
13
|
|
|
14
14
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
|
|
15
15
|
|
|
16
|
-
GEMFILE_RAILS_VERSION = '
|
|
16
|
+
GEMFILE_RAILS_VERSION = '8.1.0'.freeze
|
|
17
|
+
GEM_VERSION_RAILS = Gem::Version.new(GEMFILE_RAILS_VERSION)
|
|
17
18
|
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
|
18
19
|
gem 'appraisal'
|
|
19
20
|
gem 'jruby-openssl', :platform => :jruby
|
|
20
21
|
gem 'rails', GEMFILE_RAILS_VERSION
|
|
21
22
|
gem 'rake'
|
|
22
|
-
if
|
|
23
|
+
if GEM_VERSION_RAILS < Gem::Version.new('6.0')
|
|
23
24
|
gem 'rspec-rails', '~> 3.4'
|
|
24
|
-
elsif
|
|
25
|
+
elsif GEM_VERSION_RAILS < Gem::Version.new('7.0')
|
|
25
26
|
gem 'rspec-rails', '~> 4.0.2'
|
|
26
27
|
else
|
|
27
28
|
gem 'rspec-rails', '~> 6.0.3'
|
|
28
29
|
end
|
|
29
30
|
|
|
30
|
-
if
|
|
31
|
+
if GEM_VERSION_RAILS < Gem::Version.new('7.1')
|
|
31
32
|
gem 'concurrent-ruby', '1.3.4'
|
|
32
33
|
end
|
|
33
34
|
|
|
34
|
-
if
|
|
35
|
+
if GEM_VERSION_RAILS < Gem::Version.new('8.0')
|
|
36
|
+
gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
|
|
37
|
+
elsif GEM_VERSION_RAILS < Gem::Version.new('6.0')
|
|
35
38
|
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
|
36
39
|
else
|
|
37
|
-
gem 'sqlite3', '~> 1
|
|
40
|
+
gem 'sqlite3', '~> 2.1', :platform => [:ruby, :mswin, :mingw]
|
|
38
41
|
end
|
|
39
42
|
|
|
40
43
|
gem 'sidekiq', '>= 6.4.0'
|
|
@@ -58,15 +61,15 @@ end
|
|
|
58
61
|
|
|
59
62
|
gem 'aws-sdk-sqs'
|
|
60
63
|
|
|
61
|
-
if
|
|
64
|
+
if GEM_VERSION_RAILS >= Gem::Version.new('5.2')
|
|
62
65
|
gem 'database_cleaner'
|
|
63
|
-
elsif
|
|
64
|
-
gem 'database_cleaner', '~> 1.8.4'
|
|
65
|
-
elsif GEMFILE_RAILS_VERSION < '5.0'
|
|
66
|
+
elsif GEM_VERSION_RAILS < Gem::Version.new('5.0')
|
|
66
67
|
gem 'database_cleaner', '~> 1.0.0'
|
|
68
|
+
else
|
|
69
|
+
gem 'database_cleaner', '~> 1.8.4'
|
|
67
70
|
end
|
|
68
71
|
|
|
69
|
-
if
|
|
72
|
+
if GEM_VERSION_RAILS < Gem::Version.new('6.0')
|
|
70
73
|
gem 'delayed_job', :require => false
|
|
71
74
|
else
|
|
72
75
|
gem 'delayed_job', '~> 4.1', :require => false
|
data/README.md
CHANGED
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-

|
|
12
|
+
[](https://github.com/rollbar/rollbar-gem/actions)
|
|
13
13
|
[](http://badge.fury.io/rb/rollbar)
|
|
14
|
-
[](https://dependabot.com/compatibility-score.html?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&new-version=latest)
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
---
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'rubygems/version'
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
|
|
5
|
+
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
|
|
6
|
+
|
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
|
8
|
+
gem 'jruby-openssl', :platform => :jruby
|
|
9
|
+
gem 'rails', '~> 7.2.0'
|
|
10
|
+
gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
|
|
11
|
+
|
|
12
|
+
gem 'rspec-rails', '~> 6.0.3'
|
|
13
|
+
|
|
14
|
+
gem 'rake'
|
|
15
|
+
|
|
16
|
+
gem 'sidekiq', '>= 6.4.0'
|
|
17
|
+
|
|
18
|
+
platforms :rbx do
|
|
19
|
+
gem 'minitest'
|
|
20
|
+
gem 'racc'
|
|
21
|
+
gem 'rubinius-developer_tools'
|
|
22
|
+
gem 'rubysl', '~> 2.0' if RUBY_VERSION.start_with?('2')
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
gem 'sucker_punch', '~> 2.0'
|
|
26
|
+
|
|
27
|
+
# We need last sinatra that uses rack 2.x and ruby 2.5.x
|
|
28
|
+
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
|
|
29
|
+
|
|
30
|
+
gem 'database_cleaner'
|
|
31
|
+
gem 'delayed_job', '4.1.10', :require => false
|
|
32
|
+
gem 'generator_spec'
|
|
33
|
+
gem 'redis', '<= 4.8.0'
|
|
34
|
+
gem 'resque'
|
|
35
|
+
gem 'secure_headers', '~> 6.3.2', :require => false
|
|
36
|
+
gem 'simplecov'
|
|
37
|
+
|
|
38
|
+
unless is_jruby
|
|
39
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
|
40
|
+
gem 'rspec-command'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
gem 'mime-types'
|
|
44
|
+
|
|
45
|
+
gem 'webmock', :require => false
|
|
46
|
+
|
|
47
|
+
gem 'aws-sdk-sqs'
|
|
48
|
+
gem 'shoryuken'
|
|
49
|
+
|
|
50
|
+
gem 'capistrano', :require => false
|
|
51
|
+
|
|
52
|
+
gemspec :path => '../'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'rubygems/version'
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
|
|
5
|
+
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
|
|
6
|
+
|
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
|
8
|
+
gem 'jruby-openssl', :platform => :jruby
|
|
9
|
+
gem 'rails', '~> 8.1.0'
|
|
10
|
+
gem 'sqlite3', '~> 2.1', :platform => [:ruby, :mswin, :mingw]
|
|
11
|
+
|
|
12
|
+
gem 'rspec-rails', '~> 6.0.3'
|
|
13
|
+
|
|
14
|
+
gem 'rake'
|
|
15
|
+
|
|
16
|
+
gem 'sidekiq', '>= 6.4.0'
|
|
17
|
+
|
|
18
|
+
platforms :rbx do
|
|
19
|
+
gem 'minitest'
|
|
20
|
+
gem 'racc'
|
|
21
|
+
gem 'rubinius-developer_tools'
|
|
22
|
+
gem 'rubysl', '~> 2.0' if RUBY_VERSION.start_with?('2')
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
gem 'sucker_punch', '~> 2.0'
|
|
26
|
+
|
|
27
|
+
# We need last sinatra that uses rack 2.x and ruby 2.5.x
|
|
28
|
+
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
|
|
29
|
+
|
|
30
|
+
gem 'database_cleaner'
|
|
31
|
+
gem 'delayed_job', '4.1.13', :require => false
|
|
32
|
+
gem 'generator_spec'
|
|
33
|
+
gem 'redis', '<= 4.8.0'
|
|
34
|
+
gem 'resque'
|
|
35
|
+
gem 'secure_headers', '~> 6.3.2', :require => false
|
|
36
|
+
gem 'simplecov'
|
|
37
|
+
|
|
38
|
+
unless is_jruby
|
|
39
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
|
40
|
+
gem 'rspec-command'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
gem 'mime-types'
|
|
44
|
+
|
|
45
|
+
gem 'webmock', :require => false
|
|
46
|
+
|
|
47
|
+
gem 'aws-sdk-sqs'
|
|
48
|
+
gem 'shoryuken'
|
|
49
|
+
|
|
50
|
+
gem 'capistrano', :require => false
|
|
51
|
+
|
|
52
|
+
gemspec :path => '../'
|
|
@@ -38,8 +38,12 @@ module Rollbar
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def exception_data(exception)
|
|
41
|
-
Rollbar.log(
|
|
42
|
-
|
|
41
|
+
Rollbar.log(
|
|
42
|
+
Rollbar.configuration.uncaught_exception_level,
|
|
43
|
+
exception,
|
|
44
|
+
:is_uncaught => true,
|
|
45
|
+
:use_exception_level_filters => true
|
|
46
|
+
)
|
|
43
47
|
end
|
|
44
48
|
end
|
|
45
49
|
end
|
data/lib/rollbar/item.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Rollbar
|
|
|
24
24
|
attr_writer :payload
|
|
25
25
|
|
|
26
26
|
attr_reader :level, :message, :exception, :extra, :configuration, :scope, :logger,
|
|
27
|
-
:notifier, :context
|
|
27
|
+
:notifier, :context, :is_uncaught
|
|
28
28
|
|
|
29
29
|
def_delegators :payload, :[]
|
|
30
30
|
|
|
@@ -47,6 +47,7 @@ module Rollbar
|
|
|
47
47
|
@payload = nil
|
|
48
48
|
@notifier = options[:notifier]
|
|
49
49
|
@context = options[:context]
|
|
50
|
+
@is_uncaught = options[:is_uncaught]
|
|
50
51
|
end
|
|
51
52
|
|
|
52
53
|
def payload
|
|
@@ -101,6 +102,11 @@ module Rollbar
|
|
|
101
102
|
|
|
102
103
|
data[:code_version] = configuration.code_version if configuration.code_version
|
|
103
104
|
|
|
105
|
+
if is_uncaught
|
|
106
|
+
data[:attributes] ||= []
|
|
107
|
+
data[:attributes] << { :key => 'is_uncaught', :value => 'true' }
|
|
108
|
+
end
|
|
109
|
+
|
|
104
110
|
return unless defined?(SecureRandom) && SecureRandom.respond_to?(:uuid)
|
|
105
111
|
|
|
106
112
|
data[:uuid] = SecureRandom.uuid
|
|
@@ -122,10 +122,10 @@ module Rollbar
|
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
def join_body(response)
|
|
125
|
-
response.to_enum.reduce(
|
|
125
|
+
response.to_enum.reduce([]) do |acc, fragment|
|
|
126
126
|
acc << fragment.to_s
|
|
127
127
|
acc
|
|
128
|
-
end
|
|
128
|
+
end.join("")
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
def close_old_response(response)
|
data/lib/rollbar/notifier.rb
CHANGED
|
@@ -132,6 +132,7 @@ module Rollbar
|
|
|
132
132
|
|
|
133
133
|
message, exception, extra, context = extract_arguments(args)
|
|
134
134
|
use_exception_level_filters = use_exception_level_filters?(extra)
|
|
135
|
+
is_uncaught = uncaught?(extra)
|
|
135
136
|
|
|
136
137
|
return 'ignored' if ignored?(exception, use_exception_level_filters) ||
|
|
137
138
|
ignore_before_process?(level, exception, message, extra)
|
|
@@ -139,7 +140,9 @@ module Rollbar
|
|
|
139
140
|
level = lookup_exception_level(level, exception,
|
|
140
141
|
use_exception_level_filters)
|
|
141
142
|
|
|
142
|
-
ret = report_with_rescue(
|
|
143
|
+
ret = report_with_rescue(
|
|
144
|
+
level, message, exception, extra, context, is_uncaught
|
|
145
|
+
)
|
|
143
146
|
|
|
144
147
|
raise(exception) if configuration.raise_on_error && exception
|
|
145
148
|
|
|
@@ -157,8 +160,8 @@ module Rollbar
|
|
|
157
160
|
true
|
|
158
161
|
end
|
|
159
162
|
|
|
160
|
-
def report_with_rescue(level, message, exception, extra, context)
|
|
161
|
-
report(level, message, exception, extra, context)
|
|
163
|
+
def report_with_rescue(level, message, exception, extra, context, is_uncaught)
|
|
164
|
+
report(level, message, exception, extra, context, is_uncaught)
|
|
162
165
|
rescue StandardError, SystemStackError => e
|
|
163
166
|
original_error = {
|
|
164
167
|
:message => message,
|
|
@@ -412,6 +415,12 @@ module Rollbar
|
|
|
412
415
|
configuration.use_exception_level_filters_default
|
|
413
416
|
end
|
|
414
417
|
|
|
418
|
+
def uncaught?(options)
|
|
419
|
+
option_value = options && options.delete(:is_uncaught)
|
|
420
|
+
|
|
421
|
+
!!option_value
|
|
422
|
+
end
|
|
423
|
+
|
|
415
424
|
def call_before_process(options)
|
|
416
425
|
options = options_for_handler(options)
|
|
417
426
|
handlers = configuration.before_process
|
|
@@ -494,7 +503,7 @@ module Rollbar
|
|
|
494
503
|
end
|
|
495
504
|
end
|
|
496
505
|
|
|
497
|
-
def report(level, message, exception, extra, context)
|
|
506
|
+
def report(level, message, exception, extra, context, is_uncaught)
|
|
498
507
|
unless message || exception || extra
|
|
499
508
|
log_error(
|
|
500
509
|
'[Rollbar] Tried to send a report with no message, exception or extra data.'
|
|
@@ -503,7 +512,7 @@ module Rollbar
|
|
|
503
512
|
return 'error'
|
|
504
513
|
end
|
|
505
514
|
|
|
506
|
-
item = build_item(level, message, exception, extra, context)
|
|
515
|
+
item = build_item(level, message, exception, extra, context, is_uncaught)
|
|
507
516
|
|
|
508
517
|
return 'ignored' if item.ignored?
|
|
509
518
|
|
|
@@ -540,7 +549,7 @@ module Rollbar
|
|
|
540
549
|
configuration.execute_hook(:on_report_internal_error, exception)
|
|
541
550
|
|
|
542
551
|
failsafe_message = 'build_item in exception_data'
|
|
543
|
-
item = build_item('error', nil, exception, { :internal => true }, nil)
|
|
552
|
+
item = build_item('error', nil, exception, { :internal => true }, nil, false)
|
|
544
553
|
|
|
545
554
|
failsafe_message = 'error in process_item'
|
|
546
555
|
process_item(item)
|
|
@@ -571,7 +580,7 @@ module Rollbar
|
|
|
571
580
|
|
|
572
581
|
## Payload building functions
|
|
573
582
|
|
|
574
|
-
def build_item(level, message, exception, extra, context)
|
|
583
|
+
def build_item(level, message, exception, extra, context, is_uncaught)
|
|
575
584
|
options = {
|
|
576
585
|
:level => level,
|
|
577
586
|
:message => message,
|
|
@@ -581,7 +590,8 @@ module Rollbar
|
|
|
581
590
|
:logger => logger,
|
|
582
591
|
:scope => scope_object,
|
|
583
592
|
:notifier => self,
|
|
584
|
-
:context => context
|
|
593
|
+
:context => context,
|
|
594
|
+
:is_uncaught => is_uncaught
|
|
585
595
|
}
|
|
586
596
|
|
|
587
597
|
item = Item.new(options)
|
|
@@ -607,11 +617,10 @@ module Rollbar
|
|
|
607
617
|
def eventmachine_callback(req)
|
|
608
618
|
req.callback do
|
|
609
619
|
if req.response_header.status == 200
|
|
610
|
-
|
|
620
|
+
log_debug '[Rollbar] Success'
|
|
611
621
|
else
|
|
612
622
|
log_warning '[Rollbar] Got unexpected status code from Rollbar.io api: ' \
|
|
613
|
-
"#{req.response_header.status}"
|
|
614
|
-
log_info "[Rollbar] Response: #{req.response}"
|
|
623
|
+
"#{req.response_header.status}, response: #{req.response}"
|
|
615
624
|
end
|
|
616
625
|
end
|
|
617
626
|
end
|
|
@@ -619,14 +628,14 @@ module Rollbar
|
|
|
619
628
|
def eventmachine_errback(req)
|
|
620
629
|
req.errback do
|
|
621
630
|
log_warning(
|
|
622
|
-
"[Rollbar] Call to API failed, status code: #{req.response_header.status}"
|
|
631
|
+
"[Rollbar] Call to API failed, status code: #{req.response_header.status}, "\
|
|
632
|
+
"response: #{req.response}"
|
|
623
633
|
)
|
|
624
|
-
log_info "[Rollbar] Error's response: #{req.response}"
|
|
625
634
|
end
|
|
626
635
|
end
|
|
627
636
|
|
|
628
637
|
def send_item(item)
|
|
629
|
-
|
|
638
|
+
log_debug '[Rollbar] Sending item'
|
|
630
639
|
|
|
631
640
|
body = item.dump
|
|
632
641
|
return unless body
|
|
@@ -640,7 +649,7 @@ module Rollbar
|
|
|
640
649
|
end
|
|
641
650
|
|
|
642
651
|
def send_body(body)
|
|
643
|
-
|
|
652
|
+
log_debug '[Rollbar] Sending json'
|
|
644
653
|
|
|
645
654
|
uri = URI.parse(configuration.endpoint)
|
|
646
655
|
|
|
@@ -750,12 +759,12 @@ module Rollbar
|
|
|
750
759
|
|
|
751
760
|
def handle_response(response)
|
|
752
761
|
if response.code == '200'
|
|
753
|
-
|
|
762
|
+
log_debug '[Rollbar] Success'
|
|
754
763
|
else
|
|
755
764
|
log_warning(
|
|
756
|
-
"[Rollbar] Got unexpected status code from Rollbar api: #{response.code}"
|
|
765
|
+
"[Rollbar] Got unexpected status code from Rollbar api: #{response.code}, " \
|
|
766
|
+
"response: #{response.body}"
|
|
757
767
|
)
|
|
758
|
-
log_info "[Rollbar] Response: #{response.body}"
|
|
759
768
|
configuration.execute_hook(:on_error_response, response)
|
|
760
769
|
end
|
|
761
770
|
end
|
|
@@ -769,7 +778,7 @@ module Rollbar
|
|
|
769
778
|
end
|
|
770
779
|
|
|
771
780
|
def do_write_item(item)
|
|
772
|
-
|
|
781
|
+
log_debug '[Rollbar] Writing item to file'
|
|
773
782
|
|
|
774
783
|
body = item.dump
|
|
775
784
|
return unless body
|
|
@@ -783,7 +792,7 @@ module Rollbar
|
|
|
783
792
|
@file.flush
|
|
784
793
|
update_file(@file, file_name)
|
|
785
794
|
|
|
786
|
-
|
|
795
|
+
log_debug '[Rollbar] Success'
|
|
787
796
|
rescue IOError => e
|
|
788
797
|
log_error "[Rollbar] Error opening/writing to file: #{e}"
|
|
789
798
|
end
|
|
@@ -846,7 +855,7 @@ module Rollbar
|
|
|
846
855
|
def schedule_item(item)
|
|
847
856
|
return unless item
|
|
848
857
|
|
|
849
|
-
|
|
858
|
+
log_debug '[Rollbar] Scheduling item'
|
|
850
859
|
|
|
851
860
|
if configuration.use_async
|
|
852
861
|
process_async_item(item)
|
|
@@ -7,33 +7,30 @@ module Rollbar
|
|
|
7
7
|
include RequestDataExtractor
|
|
8
8
|
|
|
9
9
|
def rollbar_person_data
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
return {} if Rollbar::Util.method_in_stack_twice(:rollbar_person_data, __FILE__)
|
|
11
|
+
|
|
12
|
+
config = Rollbar.configuration
|
|
13
|
+
user = send(config.person_method)
|
|
14
|
+
return {} unless user
|
|
14
15
|
|
|
15
16
|
# include id, username, email if non-empty
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
else
|
|
35
|
-
{}
|
|
36
|
-
end
|
|
17
|
+
{
|
|
18
|
+
:id => (begin
|
|
19
|
+
user.send(config.person_id_method) if config.person_id_method
|
|
20
|
+
rescue StandardError
|
|
21
|
+
nil
|
|
22
|
+
end),
|
|
23
|
+
:username => (begin
|
|
24
|
+
user.send(config.person_username_method) if config.person_username_method
|
|
25
|
+
rescue StandardError
|
|
26
|
+
nil
|
|
27
|
+
end),
|
|
28
|
+
:email => (begin
|
|
29
|
+
user.send(config.person_email_method) if config.person_email_method
|
|
30
|
+
rescue StandardError
|
|
31
|
+
nil
|
|
32
|
+
end)
|
|
33
|
+
}
|
|
37
34
|
rescue NameError
|
|
38
35
|
{}
|
|
39
36
|
end
|
|
@@ -6,6 +6,13 @@ module Rollbar
|
|
|
6
6
|
|
|
7
7
|
extra = context.is_a?(Hash) ? context.deep_dup : {}
|
|
8
8
|
extra[:custom_data_method_context] = source
|
|
9
|
+
|
|
10
|
+
# Rails auto injected context
|
|
11
|
+
extra[:controller] = extra[:controller].class.name if extra[:controller]&.respond_to?(:class)
|
|
12
|
+
extra[:job] = extra[:job].class.name if extra[:job]&.respond_to?(:class)
|
|
13
|
+
extra[:is_uncaught] = !handled
|
|
14
|
+
extra[:use_exception_level_filters] = !handled
|
|
15
|
+
|
|
9
16
|
Rollbar.log(severity, error, extra)
|
|
10
17
|
end
|
|
11
18
|
end
|
data/lib/rollbar/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rollbar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rollbar, Inc.
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Track and debug errors in your Ruby applications with ease using Rollbar.
|
|
14
13
|
With this gem, you can easily monitor and report on exceptions and other errors
|
|
@@ -48,6 +47,8 @@ files:
|
|
|
48
47
|
- gemfiles/rails61.gemfile
|
|
49
48
|
- gemfiles/rails70.gemfile
|
|
50
49
|
- gemfiles/rails71.gemfile
|
|
50
|
+
- gemfiles/rails72.gemfile
|
|
51
|
+
- gemfiles/rails81.gemfile
|
|
51
52
|
- lib/generators/rollbar/rollbar_generator.rb
|
|
52
53
|
- lib/generators/rollbar/templates/initializer.erb
|
|
53
54
|
- lib/rails/rollbar_runner.rb
|
|
@@ -146,7 +147,6 @@ metadata:
|
|
|
146
147
|
bug_tracker_uri: https://github.com/rollbar/rollbar-gem/issues
|
|
147
148
|
homepage_uri: https://rollbar.com/
|
|
148
149
|
documentation_uri: https://docs.rollbar.com/docs/ruby
|
|
149
|
-
post_install_message:
|
|
150
150
|
rdoc_options: []
|
|
151
151
|
require_paths:
|
|
152
152
|
- lib
|
|
@@ -161,8 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
161
161
|
- !ruby/object:Gem::Version
|
|
162
162
|
version: '0'
|
|
163
163
|
requirements: []
|
|
164
|
-
rubygems_version: 3.
|
|
165
|
-
signing_key:
|
|
164
|
+
rubygems_version: 3.6.9
|
|
166
165
|
specification_version: 4
|
|
167
166
|
summary: Reports exceptions to Rollbar
|
|
168
167
|
test_files: []
|