honeybadger 4.10.0 → 4.12.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/CHANGELOG.md +16 -0
- data/lib/honeybadger/cli/test.rb +1 -1
- data/lib/honeybadger/notice.rb +2 -2
- data/lib/honeybadger/plugin.rb +2 -2
- data/lib/honeybadger/plugins/lambda.rb +44 -0
- data/lib/honeybadger/rack/error_notifier.rb +1 -1
- data/lib/honeybadger/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d985044e0beefd1486ddc3052c4d5f727bd24b8c05ba710b1cd0e8043531754b
|
4
|
+
data.tar.gz: f1dbce0ac245935193d5594a8fa3a2aecbd3c1edf4c8a68793d9b687e1b69b2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db5ca1dca68890022b29ee5b9afc206bcf8bfe4bb8bbb774207e61497372d8b2a1a6e43d8b5d2d356e8c3a8207da872d8d5a01574ecf968139072586f47734d1
|
7
|
+
data.tar.gz: e15cc2b6bfd1873027354d9ee1f92ad7e7cfbe870b504b881689040d414ba24048f4c8346cf8f219aed5e9479c6ced1cc12f6b069ea80ca7da27f9e3b57d09c9
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,22 @@ adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [4.12.1] - 2022-04-01
|
9
|
+
### Fixed
|
10
|
+
- Fix Lambda plugin: support Ruby <2.5 (#428)
|
11
|
+
|
12
|
+
## [4.12.0] - 2022-03-30
|
13
|
+
### Added
|
14
|
+
- Added `hb_wrap_handler` to automatically capture AWS Lambda handler errors
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
- Change `:exception_message` key name to just `:exception` for error breadcrumb metadata.
|
18
|
+
|
19
|
+
## [4.11.0] - 2022-02-15
|
20
|
+
### Fixed
|
21
|
+
- Allow special characters in tags. Also support space-delimited tags:
|
22
|
+
"one two three" and "one, two, three" are equivalent
|
23
|
+
|
8
24
|
## [4.10.0] - 2022-01-19
|
9
25
|
### Added
|
10
26
|
- Add more items to the default config file
|
data/lib/honeybadger/cli/test.rb
CHANGED
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,56 @@ 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
|
+
begin
|
30
|
+
Honeybadger.context(aws_request_id: context.aws_request_id) if context.respond_to?(:aws_request_id)
|
31
|
+
|
32
|
+
super(event: event, context: context)
|
33
|
+
rescue => e
|
34
|
+
Honeybadger.notify(e)
|
35
|
+
raise
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
self.singleton_class.prepend(mod)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
6
45
|
# @api private
|
7
46
|
Plugin.register :lambda do
|
8
47
|
requirement { Util::Lambda.lambda_execution? }
|
9
48
|
|
10
49
|
execution do
|
11
50
|
config[:sync] = true
|
51
|
+
config[:'exceptions.notify_at_exit'] = false
|
52
|
+
|
53
|
+
main = TOPLEVEL_BINDING.eval("self")
|
54
|
+
main.extend(LambdaExtension)
|
55
|
+
|
12
56
|
(config[:before_notify] ||= []) << lambda do |notice|
|
13
57
|
data = Util::Lambda.normalized_data
|
14
58
|
|
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.1
|
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-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make managing application errors a more pleasant experience.
|
14
14
|
email:
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
rubygems_version: 3.
|
156
|
+
rubygems_version: 3.2.3
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Error reports you can be happy about.
|