airbrake 11.0.2 → 11.0.3
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/lib/airbrake/rails/action_cable.rb +19 -17
- data/lib/airbrake/rake.rb +47 -46
- data/lib/airbrake/resque.rb +26 -25
- data/lib/airbrake/sneakers.rb +29 -27
- data/lib/airbrake/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd22c4ba5f388c063021267c805f9f72f9905c8e0f7a2b7e19d0f6a45c9718a9
|
4
|
+
data.tar.gz: b919ee2bdae1a073c939b752d9827f3d8ecd6c30f18739019f9becbf6974a605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2362a03c41aebeddaf2e6bcd2272760ea0fb94b88a0dcabb644ab5c9b3a72ed72281f05f314f04491e27d99fae9c5353bbfaa4fc1d43f09d3e2316f6edfb02ba
|
7
|
+
data.tar.gz: f260895a27e6f8e2368c2be1431344291d5dcdf731f0d4b71d4ab2f14de1265cb93759c888ad03592b02dabaa7944e9c4dfbfed4fb87b443e3aaddeba0321760
|
@@ -10,26 +10,28 @@ require 'airbrake/rails/action_cable/notify_callback'
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
module
|
14
|
-
module
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
module Airbrake
|
14
|
+
module ActionCable
|
15
|
+
module Channel
|
16
|
+
# @since v8.3.0
|
17
|
+
# @api private
|
18
|
+
# @see https://github.com/rails/rails/blob/master/actioncable/lib/action_cable/channel/base.rb
|
19
|
+
module Base
|
20
|
+
def perform_action(*args, &block)
|
21
|
+
super(*args, &block)
|
22
|
+
rescue Exception => ex # rubocop:disable Lint/RescueException
|
23
|
+
Airbrake.notify(ex) do |notice|
|
24
|
+
notice.stash[:action_cable_connection] = connection
|
25
|
+
notice[:context][:component] = self.class
|
26
|
+
notice[:context][:action] = args.first['action']
|
27
|
+
notice[:params].merge!(args.first)
|
28
|
+
end
|
20
29
|
|
21
|
-
|
22
|
-
perform_action_without_airbrake(*args, &block)
|
23
|
-
rescue Exception => ex # rubocop:disable Lint/RescueException
|
24
|
-
Airbrake.notify(ex) do |notice|
|
25
|
-
notice.stash[:action_cable_connection] = connection
|
26
|
-
notice[:context][:component] = self.class
|
27
|
-
notice[:context][:action] = args.first['action']
|
28
|
-
notice[:params].merge!(args.first)
|
30
|
+
raise ex
|
29
31
|
end
|
30
|
-
|
31
|
-
raise ex
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
ActionCable::Channel::Base.prepend(Airbrake::ActionCable::Channel::Base)
|
data/lib/airbrake/rake.rb
CHANGED
@@ -5,61 +5,62 @@
|
|
5
5
|
# See: https://goo.gl/ksn6PE
|
6
6
|
Rake::TaskManager.record_task_metadata = true
|
7
7
|
|
8
|
-
module
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
# rubocop:enable Lint/RescueException
|
8
|
+
module Airbrake
|
9
|
+
module Rake
|
10
|
+
# Redefine +Rake::Task#execute+, so it can report errors to Airbrake.
|
11
|
+
module Task
|
12
|
+
# A wrapper around the original +#execute+, that catches all errors and
|
13
|
+
# notifies Airbrake.
|
14
|
+
#
|
15
|
+
# rubocop:disable Lint/RescueException
|
16
|
+
def execute(args = nil)
|
17
|
+
super(args)
|
18
|
+
rescue Exception => ex
|
19
|
+
notify_airbrake(ex, args)
|
20
|
+
raise ex
|
21
|
+
end
|
22
|
+
# rubocop:enable Lint/RescueException
|
25
23
|
|
26
|
-
|
24
|
+
private
|
27
25
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
def notify_airbrake(exception, args)
|
27
|
+
notice = Airbrake.build_notice(exception)
|
28
|
+
notice[:context][:component] = 'rake'
|
29
|
+
notice[:context][:action] = name
|
30
|
+
notice[:params].merge!(
|
31
|
+
rake_task: task_info,
|
32
|
+
execute_args: args,
|
33
|
+
argv: ARGV.join(' '),
|
34
|
+
)
|
37
35
|
|
38
|
-
|
39
|
-
|
36
|
+
Airbrake.notify_sync(notice)
|
37
|
+
end
|
40
38
|
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize
|
40
|
+
def task_info
|
41
|
+
info = {}
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
info[:name] = name
|
44
|
+
info[:timestamp] = timestamp.to_s
|
45
|
+
info[:investigation] = investigation
|
48
46
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
info[:full_comment] = full_comment if full_comment
|
48
|
+
info[:arg_names] = arg_names if arg_names.any?
|
49
|
+
info[:arg_description] = arg_description if arg_description
|
50
|
+
info[:locations] = locations if locations.any?
|
51
|
+
info[:sources] = sources if sources.any?
|
54
52
|
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
if prerequisite_tasks.any?
|
54
|
+
info[:prerequisite_tasks] = prerequisite_tasks.map do |p|
|
55
|
+
p.__send__(:task_info)
|
56
|
+
end
|
58
57
|
end
|
59
|
-
end
|
60
58
|
|
61
|
-
|
59
|
+
info
|
60
|
+
end
|
61
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize
|
62
62
|
end
|
63
|
-
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize
|
64
63
|
end
|
65
64
|
end
|
65
|
+
|
66
|
+
Rake::Task.prepend(Airbrake::Rake::Task)
|
data/lib/airbrake/resque.rb
CHANGED
@@ -30,32 +30,33 @@ module Resque
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
module
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
33
|
+
module Airbrake
|
34
|
+
module Resque
|
35
|
+
# Measures elapsed time of a job and notifies Airbrake of the execution
|
36
|
+
# status.
|
37
|
+
#
|
38
|
+
# @since v9.6.0
|
39
|
+
module Job
|
40
|
+
def perform
|
41
|
+
timing = Airbrake::Benchmark.measure do
|
42
|
+
super
|
43
|
+
end
|
44
|
+
rescue StandardError => exception
|
45
|
+
Airbrake.notify_queue_sync(
|
46
|
+
queue: payload['class'],
|
47
|
+
error_count: 1,
|
48
|
+
timing: 0.01,
|
49
|
+
)
|
50
|
+
raise exception
|
51
|
+
else
|
52
|
+
Airbrake.notify_queue_sync(
|
53
|
+
queue: payload['class'],
|
54
|
+
error_count: 0,
|
55
|
+
timing: timing,
|
56
|
+
)
|
45
57
|
end
|
46
|
-
rescue StandardError => exception
|
47
|
-
Airbrake.notify_queue_sync(
|
48
|
-
queue: payload['class'],
|
49
|
-
error_count: 1,
|
50
|
-
timing: 0.01,
|
51
|
-
)
|
52
|
-
raise exception
|
53
|
-
else
|
54
|
-
Airbrake.notify_queue_sync(
|
55
|
-
queue: payload['class'],
|
56
|
-
error_count: 0,
|
57
|
-
timing: timing,
|
58
|
-
)
|
59
58
|
end
|
60
59
|
end
|
61
60
|
end
|
61
|
+
|
62
|
+
Resque::Job.prepend(Airbrake::Resque::Job)
|
data/lib/airbrake/sneakers.rb
CHANGED
@@ -39,34 +39,36 @@ end
|
|
39
39
|
|
40
40
|
Sneakers.error_reporters << Airbrake::Sneakers::ErrorReporter.new
|
41
41
|
|
42
|
-
module
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
42
|
+
module Airbrake
|
43
|
+
module Sneakers
|
44
|
+
# @todo Migrate to Sneakers v2.12.0 middleware API when it's released
|
45
|
+
# @see https://github.com/jondot/sneakers/pull/364
|
46
|
+
module Worker
|
47
|
+
# Sneakers v2.7.0+ renamed `do_work` to `process_work`.
|
48
|
+
define_method(
|
49
|
+
::Sneakers::Worker.method_defined?(:process_work) ? :process_work : :do_work,
|
50
|
+
) do |delivery_info, metadata, msg, handler|
|
51
|
+
begin
|
52
|
+
timing = Airbrake::Benchmark.measure do
|
53
|
+
super(delivery_info, metadata, msg, handler)
|
54
|
+
end
|
55
|
+
rescue Exception => exception # rubocop:disable Lint/RescueException
|
56
|
+
Airbrake.notify_queue(
|
57
|
+
queue: self.class.to_s,
|
58
|
+
error_count: 1,
|
59
|
+
timing: 0.01,
|
60
|
+
)
|
61
|
+
raise exception
|
62
|
+
else
|
63
|
+
Airbrake.notify_queue(
|
64
|
+
queue: self.class.to_s,
|
65
|
+
error_count: 0,
|
66
|
+
timing: timing,
|
67
|
+
)
|
68
|
+
end
|
56
69
|
end
|
57
|
-
rescue Exception => exception # rubocop:disable Lint/RescueException
|
58
|
-
Airbrake.notify_queue(
|
59
|
-
queue: self.class.to_s,
|
60
|
-
error_count: 1,
|
61
|
-
timing: 0.01,
|
62
|
-
)
|
63
|
-
raise exception
|
64
|
-
else
|
65
|
-
Airbrake.notify_queue(
|
66
|
-
queue: self.class.to_s,
|
67
|
-
error_count: 0,
|
68
|
-
timing: timing,
|
69
|
-
)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
73
|
+
|
74
|
+
Sneakers::Worker.prepend(Airbrake::Sneakers::Worker)
|
data/lib/airbrake/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.0.
|
4
|
+
version: 11.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake-ruby
|