honeybadger 4.9.0 → 4.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -3
- data/README.md +0 -1
- data/lib/honeybadger/cli/install.rb +26 -0
- data/lib/honeybadger/config/yaml.rb +5 -1
- data/lib/honeybadger/notice.rb +2 -2
- data/lib/honeybadger/plugin.rb +2 -2
- data/lib/honeybadger/plugins/lambda.rb +42 -0
- data/lib/honeybadger/rack/error_notifier.rb +1 -1
- data/lib/honeybadger/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc234e187c3022616088debc469df8f765cde38e4f3f8bf008eab97ce1d0133e
|
4
|
+
data.tar.gz: 45d332816e07aa7d25e78cc075c2b2017eb51a97583ed0ba4709087adab023b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f344e35e9a2928a3660aa0d6a55d695d58854f81b13d0ab13be4771c6a54a38893d2d0b2cee10f44e88f19140122803aa6f423072f1c39db0124686b252884e
|
7
|
+
data.tar.gz: bb7844be57da52cabf400a22fe09d5a45c9b3187e1eee224672f0ad000ea262002e16d36c754a2f5a7eedbce9b1e46bae9d765b351bf7b59c8df87a1fab46a3d
|
data/CHANGELOG.md
CHANGED
@@ -5,12 +5,34 @@ adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [4.12.0] - 2022-03-30
|
9
|
+
### Added
|
10
|
+
- Added `hb_wrap_handler` to automatically capture AWS Lambda handler errors
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
- Change `:exception_message` key name to just `:exception` for error breadcrumb metadata.
|
14
|
+
|
15
|
+
## [4.11.0] - 2022-02-15
|
16
|
+
### Fixed
|
17
|
+
- Allow special characters in tags. Also support space-delimited tags:
|
18
|
+
"one two three" and "one, two, three" are equivalent
|
19
|
+
|
20
|
+
## [4.10.0] - 2022-01-19
|
21
|
+
### Added
|
22
|
+
- Add more items to the default config file
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
- Fix a Ruby 3.1 bug that breaks regexp classes in honeybadger.yml (#418)
|
26
|
+
|
8
27
|
## [4.9.0] - 2021-06-28
|
9
|
-
|
10
|
-
default ignore list. (#402, @jrochkind)
|
28
|
+
### Fixed
|
11
29
|
- Replaced fixed number for retries in Sidekiq Plugin with Sidekiq::JobRetry constant
|
12
30
|
- Properly set environment in deployment tracking (#404, @stmllr)
|
13
31
|
|
32
|
+
### Added
|
33
|
+
- Added 'ActionDispatch::Http::MimeNegotiation::InvalidType' (Rails 6.1) to
|
34
|
+
default ignore list. (#402, @jrochkind)
|
35
|
+
|
14
36
|
## [4.8.0] - 2021-03-16
|
15
37
|
### Fixed
|
16
38
|
- Suppress any error output from the `git rev-parse` command. ([#394](https://github.com/honeybadger-io/honeybadger-ruby/pull/394))
|
@@ -49,7 +71,7 @@ adheres to [Semantic Versioning](http://semver.org/).
|
|
49
71
|
### Fixed
|
50
72
|
- Fixed issue where Sidekiq.attempt_threshold was triggering 2 attempts ahead
|
51
73
|
of the setting
|
52
|
-
-
|
74
|
+
- Dupe notify opts before mutating (#345)
|
53
75
|
|
54
76
|
### Changed
|
55
77
|
- Breadcrumbs on by default
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
![Ruby](https://github.com/honeybadger-io/honeybadger-ruby/workflows/Ruby/badge.svg)
|
4
4
|
![JRuby](https://github.com/honeybadger-io/honeybadger-ruby/workflows/JRuby/badge.svg)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/honeybadger.svg)](http://badge.fury.io/rb/honeybadger)
|
6
|
-
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=honeybadger&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=honeybadger&package-manager=bundler&version-scheme=semver)
|
7
6
|
|
8
7
|
This is the notifier gem for integrating apps with the :zap: [Honeybadger Exception Notifier for Ruby and Rails](http://honeybadger.io).
|
9
8
|
|
@@ -43,10 +43,36 @@ module Honeybadger
|
|
43
43
|
exit(1)
|
44
44
|
end
|
45
45
|
|
46
|
+
default_env = defined?(::Rails.application) ? "Rails.env" : "ENV['RUBY_ENV'] || ENV['RACK_ENV']"
|
47
|
+
default_root = defined?(::Rails.application) ? "Rails.root.to_s" : "Dir.pwd"
|
46
48
|
File.open(path, 'w+') do |file|
|
47
49
|
file.write(<<-CONFIG)
|
48
50
|
---
|
51
|
+
# For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
|
52
|
+
|
49
53
|
api_key: '#{api_key}'
|
54
|
+
|
55
|
+
# The environment your app is running in.
|
56
|
+
env: "<%= #{default_env} %>"
|
57
|
+
|
58
|
+
# The absolute path to your project folder.
|
59
|
+
root: "<%= #{default_root} %>"
|
60
|
+
|
61
|
+
# Honeybadger won't report errors in these environments.
|
62
|
+
development_environments:
|
63
|
+
- test
|
64
|
+
- development
|
65
|
+
- cucumber
|
66
|
+
|
67
|
+
# By default, Honeybadger won't report errors in the development_environments.
|
68
|
+
# You can override this by explicitly setting report_data to true or false.
|
69
|
+
# report_data: true
|
70
|
+
|
71
|
+
# The current Git revision of your project. Defaults to the last commit hash.
|
72
|
+
# revision: null
|
73
|
+
|
74
|
+
# Enable verbose debug logging (useful for troubleshooting).
|
75
|
+
debug: false
|
50
76
|
CONFIG
|
51
77
|
end
|
52
78
|
end
|
@@ -26,7 +26,11 @@ module Honeybadger
|
|
26
26
|
|
27
27
|
def self.load_yaml(path)
|
28
28
|
begin
|
29
|
-
|
29
|
+
# This uses `YAML.unsafe_load` to support loading arbitrary Ruby
|
30
|
+
# classes, such as !ruby/regexp. This was the default behavior prior
|
31
|
+
# to Psych 4. https://bugs.ruby-lang.org/issues/17866
|
32
|
+
method = YAML.respond_to?(:unsafe_load) ? :unsafe_load : :load
|
33
|
+
yaml = YAML.send(method, ERB.new(path.read).result)
|
30
34
|
rescue => e
|
31
35
|
config_error = ConfigError.new(e.to_s)
|
32
36
|
|
data/lib/honeybadger/notice.rb
CHANGED
@@ -53,11 +53,11 @@ module Honeybadger
|
|
53
53
|
|
54
54
|
# @api private
|
55
55
|
# The String character used to split tag strings.
|
56
|
-
TAG_SEPERATOR =
|
56
|
+
TAG_SEPERATOR = /,|\s/.freeze
|
57
57
|
|
58
58
|
# @api private
|
59
59
|
# The Regexp used to strip invalid characters from individual tags.
|
60
|
-
TAG_SANITIZER =
|
60
|
+
TAG_SANITIZER = /\s/.freeze
|
61
61
|
|
62
62
|
# @api private
|
63
63
|
class Cause
|
data/lib/honeybadger/plugin.rb
CHANGED
@@ -2,7 +2,7 @@ require 'forwardable'
|
|
2
2
|
|
3
3
|
module Honeybadger
|
4
4
|
# +Honeybadger::Plugin+ defines the API for registering plugins with
|
5
|
-
# Honeybadger. Each plugin has requirements which must be
|
5
|
+
# Honeybadger. Each plugin has requirements which must be satisfied before
|
6
6
|
# executing the plugin's execution block(s). This allows us to detect
|
7
7
|
# optional dependencies and load the plugin for each dependency only if it's
|
8
8
|
# present in the application.
|
@@ -62,7 +62,7 @@ module Honeybadger
|
|
62
62
|
# execution { }
|
63
63
|
# end
|
64
64
|
#
|
65
|
-
# @param [String] name The optional name of the plugin. Should use
|
65
|
+
# @param [String, Symbol] name The optional name of the plugin. Should use
|
66
66
|
# +snake_case+. The name is inferred from the current file name if omitted.
|
67
67
|
#
|
68
68
|
# @return nil
|
@@ -3,12 +3,54 @@ require 'honeybadger/util/lambda'
|
|
3
3
|
|
4
4
|
module Honeybadger
|
5
5
|
module Plugins
|
6
|
+
module LambdaExtension
|
7
|
+
# Wrap Lambda handlers so exceptions can be automatically captured
|
8
|
+
#
|
9
|
+
# Usage:
|
10
|
+
#
|
11
|
+
# # Automatically included in the top-level main object
|
12
|
+
# hb_wrap_handler :my_handler_1, :my_handler_2
|
13
|
+
#
|
14
|
+
# def my_handler_1(event:, context:)
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# class MyLambdaApp
|
18
|
+
# extend ::Honeybadger::Plugins::LambdaExtension
|
19
|
+
#
|
20
|
+
# hb_wrap_handler :my_handler_1, :my_handler_2
|
21
|
+
#
|
22
|
+
# def self.my_handler_1(event:, context:)
|
23
|
+
# end
|
24
|
+
# end
|
25
|
+
def hb_wrap_handler(*handler_names)
|
26
|
+
mod = Module.new do
|
27
|
+
handler_names.each do |handler|
|
28
|
+
define_method(handler) do |event:, context:|
|
29
|
+
Honeybadger.context(aws_request_id: context.aws_request_id) if context.respond_to?(:aws_request_id)
|
30
|
+
|
31
|
+
super(event: event, context: context)
|
32
|
+
rescue => e
|
33
|
+
Honeybadger.notify(e)
|
34
|
+
raise
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
self.singleton_class.prepend(mod)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
6
43
|
# @api private
|
7
44
|
Plugin.register :lambda do
|
8
45
|
requirement { Util::Lambda.lambda_execution? }
|
9
46
|
|
10
47
|
execution do
|
11
48
|
config[:sync] = true
|
49
|
+
config[:'exceptions.notify_at_exit'] = false
|
50
|
+
|
51
|
+
main = TOPLEVEL_BINDING.eval("self")
|
52
|
+
main.extend(LambdaExtension)
|
53
|
+
|
12
54
|
(config[:before_notify] ||= []) << lambda do |notice|
|
13
55
|
data = Util::Lambda.normalized_data
|
14
56
|
|
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.
|
4
|
+
version: 4.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Honeybadger Industries LLC
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make managing application errors a more pleasant experience.
|
14
14
|
email:
|
@@ -135,7 +135,7 @@ homepage: https://github.com/honeybadger-io/honeybadger-ruby
|
|
135
135
|
licenses:
|
136
136
|
- MIT
|
137
137
|
metadata: {}
|
138
|
-
post_install_message:
|
138
|
+
post_install_message:
|
139
139
|
rdoc_options:
|
140
140
|
- "--markup=tomdoc"
|
141
141
|
- "--main=README.md"
|
@@ -153,8 +153,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
rubygems_version: 3.
|
157
|
-
signing_key:
|
156
|
+
rubygems_version: 3.2.3
|
157
|
+
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Error reports you can be happy about.
|
160
160
|
test_files: []
|