honeybadger 4.12.2 → 5.0.2
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 +28 -0
- data/lib/honeybadger/agent.rb +7 -0
- data/lib/honeybadger/backend/test.rb +1 -0
- data/lib/honeybadger/cli/heroku.rb +1 -1
- data/lib/honeybadger/config/defaults.rb +7 -1
- data/lib/honeybadger/init/rails.rb +4 -1
- data/lib/honeybadger/plugins/rails.rb +15 -0
- data/lib/honeybadger/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: 807947f2bfdd4fac0c50e1665b0538eb42e5811f30903b7f9e6e19cacc5e999b
|
4
|
+
data.tar.gz: 1e3b8f5e462963083a41e336378d2e8a25a6efadf70e5216992be5e2517f814c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dad8d9da2e9a648796ad3cedc58fadc7f5c1144e4b0985556f7dbba92348ee36b08073fb8d67a0b1ff2920c12b853b8b937b80f1f351fd172348fd3119f9dc0
|
7
|
+
data.tar.gz: f5c7cc958c542c60a85abe624e6625fe30e449e6d3bef6760f05a8218134ea92b74b6c982460739d828069aa17e21cb6303adb5e6568699543099587c406fb9c
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,34 @@ adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [5.0.2] - 2022-11-04
|
9
|
+
### Fixed
|
10
|
+
- `Honeybadger.check_in` would raise an exception when used with the test backend (#449)
|
11
|
+
|
12
|
+
## [5.0.1] - 2022-10-27
|
13
|
+
### Fixed
|
14
|
+
- Ignore `Sidekiq::JobRetry` skip exception. Since support was added for Rails 7
|
15
|
+
error reporting interface these exceptions are being reported in addition to
|
16
|
+
the exception that caused the job to be retried. Mike Perham says these
|
17
|
+
exceptions can safely be ignored.
|
18
|
+
See https://github.com/rails/rails/pull/43625#issuecomment-1071574110
|
19
|
+
|
20
|
+
## [5.0.0] - 2022-10-18
|
21
|
+
### Changed
|
22
|
+
- `Honeybadger.notify` is now idempotent; it will skip reporting exception
|
23
|
+
objects that have already been reported before, and simply return the existing
|
24
|
+
notice ID.
|
25
|
+
- Honeybadger is now initialized before Rails' initializers, allowing you to
|
26
|
+
report errors raised during startup. Config added via `Honeybadger.configure`
|
27
|
+
is added later in the Rails initialization process.
|
28
|
+
|
29
|
+
### Added
|
30
|
+
- Support Rails 7 error reporting interface (#443)
|
31
|
+
|
32
|
+
### Fixed
|
33
|
+
- Replace deployhook with release webhook (#444)
|
34
|
+
See https://blog.heroku.com/deployhooks-sunset
|
35
|
+
|
8
36
|
## [4.12.2] - 2022-08-15
|
9
37
|
### Fixed
|
10
38
|
- Fix a bug where the auto-detected revision is blank instead of nil
|
data/lib/honeybadger/agent.rb
CHANGED
@@ -122,6 +122,9 @@ module Honeybadger
|
|
122
122
|
opts = opts.dup
|
123
123
|
|
124
124
|
if exception_or_opts.is_a?(Exception)
|
125
|
+
already_reported_notice_id = exception_or_opts.instance_variable_get(:@__hb_notice_id)
|
126
|
+
return already_reported_notice_id if already_reported_notice_id
|
127
|
+
|
125
128
|
opts[:exception] = exception_or_opts
|
126
129
|
elsif exception_or_opts.respond_to?(:to_hash)
|
127
130
|
opts.merge!(exception_or_opts.to_hash)
|
@@ -171,6 +174,10 @@ module Honeybadger
|
|
171
174
|
push(notice)
|
172
175
|
end
|
173
176
|
|
177
|
+
if exception_or_opts.is_a?(Exception)
|
178
|
+
exception_or_opts.instance_variable_set(:@__hb_notice_id, notice.id) unless exception_or_opts.frozen?
|
179
|
+
end
|
180
|
+
|
174
181
|
notice.id
|
175
182
|
end
|
176
183
|
|
@@ -23,7 +23,7 @@ module Honeybadger
|
|
23
23
|
exit(1)
|
24
24
|
end
|
25
25
|
|
26
|
-
cmd = %Q(heroku
|
26
|
+
cmd = %Q(heroku webhooks:add -i api:release -l notify -u "https://api.honeybadger.io/v1/deploys/heroku?environment=#{rails_env}&api_key=#{api_key}"#{app ? " --app #{app}" : ''})
|
27
27
|
|
28
28
|
say("Running: `#{cmd}`")
|
29
29
|
say(run(cmd))
|
@@ -28,7 +28,8 @@ module Honeybadger
|
|
28
28
|
'Rack::QueryParser::InvalidParameterError',
|
29
29
|
'CGI::Session::CookieStore::TamperedWithCookie',
|
30
30
|
'Mongoid::Errors::DocumentNotFound',
|
31
|
-
'Sinatra::NotFound'
|
31
|
+
'Sinatra::NotFound',
|
32
|
+
'Sidekiq::JobRetry::Skip'].map(&:freeze).freeze
|
32
33
|
|
33
34
|
DEVELOPMENT_ENVIRONMENTS = ['development', 'test', 'cucumber'].map(&:freeze).freeze
|
34
35
|
|
@@ -300,6 +301,11 @@ module Honeybadger
|
|
300
301
|
default: true,
|
301
302
|
type: Boolean
|
302
303
|
},
|
304
|
+
:'rails.subscriber_ignore_sources' => {
|
305
|
+
description: "Sources (strings or regexes) that should be ignored when using the Rails' (7+) native error reporter.",
|
306
|
+
default: [],
|
307
|
+
type: Array
|
308
|
+
},
|
303
309
|
:'resque.resque_retry.send_exceptions_when_retrying' => {
|
304
310
|
description: 'Send exceptions when retrying job.',
|
305
311
|
default: true,
|
@@ -17,7 +17,7 @@ module Honeybadger
|
|
17
17
|
app.config.middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserFeedback)
|
18
18
|
end
|
19
19
|
|
20
|
-
config.
|
20
|
+
config.before_initialize do
|
21
21
|
Honeybadger.init!({
|
22
22
|
:root => ::Rails.root.to_s,
|
23
23
|
:env => ::Rails.env,
|
@@ -25,6 +25,9 @@ module Honeybadger
|
|
25
25
|
:logger => Logging::FormattedLogger.new(::Rails.logger),
|
26
26
|
:framework => :rails
|
27
27
|
})
|
28
|
+
end
|
29
|
+
|
30
|
+
config.after_initialize do
|
28
31
|
Honeybadger.load_plugins!
|
29
32
|
end
|
30
33
|
end
|
@@ -29,6 +29,16 @@ module Honeybadger
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
class ErrorSubscriber
|
33
|
+
def self.report(exception, handled:, severity:, context: {}, source: nil)
|
34
|
+
return if source && ::Honeybadger.config[:'rails.subscriber_ignore_sources'].any? { |regex| regex.match?(source) }
|
35
|
+
|
36
|
+
tags = ["severity:#{severity}", "handled:#{handled}"]
|
37
|
+
tags << "source:#{source}" if source
|
38
|
+
Honeybadger.notify(exception, context: context, tags: tags)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
32
42
|
Plugin.register :rails_exceptions_catcher do
|
33
43
|
requirement { defined?(::Rails.application) && ::Rails.application }
|
34
44
|
|
@@ -41,6 +51,11 @@ module Honeybadger
|
|
41
51
|
# Rails 3.0.x and 3.1.x
|
42
52
|
::ActionDispatch::ShowExceptions.prepend(ExceptionsCatcher)
|
43
53
|
end
|
54
|
+
|
55
|
+
if defined?(::ActiveSupport::ErrorReporter)
|
56
|
+
# Rails 7
|
57
|
+
::Rails.error.subscribe(ErrorSubscriber)
|
58
|
+
end
|
44
59
|
end
|
45
60
|
end
|
46
61
|
end
|
data/lib/honeybadger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeybadger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Honeybadger Industries LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make managing application errors a more pleasant experience.
|
14
14
|
email:
|