honeybadger 4.11.0 → 4.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1542f59cbe55ad29fba4ea1ccc9acf4cc6fb36fa14bf6485f127846442682bdc
4
- data.tar.gz: 84f3fe4e7ed2b07548107f247585a3ecc38f411f8f8ac8ec23bd271fa80c942e
3
+ metadata.gz: 27ff7c374bbf6bcfb0086d8494399ecaf46b20cca0f37cb032abc883e3115c85
4
+ data.tar.gz: 658f3b9ef36a76771265af32bddbf3c6e720385c8051cece4b15f339abdad364
5
5
  SHA512:
6
- metadata.gz: 074db0c6d16b50320a7ee86c4c63b229ecc97ce4841c6e5ba7791b637481150a236a6900fa55ff97075843b87b773c92f8469aaad46559e73624f46c0b5caf70
7
- data.tar.gz: 9a7968da09fa17c8e6c60768baeaea4173387b494913e5d90cca8984d39b0565886f387e9f113e7d321a8bc33f09a82419d6170fdf6dfa2f2fc74bfd3e79d35d
6
+ metadata.gz: 0641dd6546f0ac77ed8175331791708f0de21a540ab6e0d7aacb56e39ed60c5e65252f6f8d7c3959df859f2dedf210df2055d38337e546e92d74ff46f0aadefa
7
+ data.tar.gz: a1ee0bd23a820ef6bcb90e05901d984418347987e2d23202ea02e43799e2f4c6ef9a7f5f84bba8a888ff7747baef76280b7a79e8993ceadafaa05d0bd465e4ac
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.2] - 2022-08-15
9
+ ### Fixed
10
+ - Fix a bug where the auto-detected revision is blank instead of nil
11
+ - Fix inadvertent creation of invalid sessions (#441)
12
+
13
+ ## [4.12.1] - 2022-04-01
14
+ ### Fixed
15
+ - Fix Lambda plugin: support Ruby <2.5 (#428)
16
+
17
+ ## [4.12.0] - 2022-03-30
18
+ ### Added
19
+ - Added `hb_wrap_handler` to automatically capture AWS Lambda handler errors
20
+
21
+ ### Fixed
22
+ - Change `:exception_message` key name to just `:exception` for error breadcrumb metadata.
23
+
8
24
  ## [4.11.0] - 2022-02-15
9
25
  ### Fixed
10
26
  - Allow special characters in tags. Also support space-delimited tags:
@@ -93,7 +93,7 @@ module Honeybadger
93
93
  end
94
94
 
95
95
  def run(cmd)
96
- Bundler.with_clean_env { `#{cmd}` }
96
+ Bundler.with_unbundled_env { `#{cmd}` }
97
97
  end
98
98
 
99
99
  def heroku_var(var, app_name, default = nil)
@@ -256,7 +256,7 @@ love: making developers awesome.
256
256
  Happy 'badgering!
257
257
 
258
258
  Sincerely,
259
- Ben, Josh and Starr
259
+ The Honeybadger Crew
260
260
  https://www.honeybadger.io/about/
261
261
 
262
262
  ⚡ --- End --------------------------------------------------------------------
@@ -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 satisified before
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,57 @@ 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
+ Kernel.singleton_class.prepend(mod) if self == TOPLEVEL_BINDING.eval("self")
43
+ end
44
+ end
45
+
6
46
  # @api private
7
47
  Plugin.register :lambda do
8
48
  requirement { Util::Lambda.lambda_execution? }
9
49
 
10
50
  execution do
11
51
  config[:sync] = true
52
+ config[:'exceptions.notify_at_exit'] = false
53
+
54
+ main = TOPLEVEL_BINDING.eval("self")
55
+ main.extend(LambdaExtension)
56
+
12
57
  (config[:before_notify] ||= []) << lambda do |notice|
13
58
  data = Util::Lambda.normalized_data
14
59
 
@@ -74,7 +74,7 @@ module Honeybadger
74
74
  agent.add_breadcrumb(
75
75
  exception.class,
76
76
  metadata: {
77
- exception_message: exception.message
77
+ message: exception.message
78
78
  },
79
79
  category: "error"
80
80
  )
@@ -4,7 +4,6 @@
4
4
  #honeybadger_feedback_form label { font-weight: bold; }
5
5
  #honeybadger_feedback_name, #honeybadger_feedback_email, #honeybadger_feedback_comment { width: 100%; padding: 0.5em; }
6
6
  #honeybadger_feedback_comment { height: 10em; }
7
- #honeybadger_feedback_submit { height: 1em; }
8
7
  #honeybadger_feedback_form .honeybadger-feedback-phone { display: none; }
9
8
  #honeybadger_feedback_link { font-size: 90%; }
10
9
  </style>
@@ -28,7 +28,7 @@ module Honeybadger
28
28
  return {} unless defined?(::Rack::Request)
29
29
  return {} unless env
30
30
 
31
- hash, request = {}, ::Rack::Request.new(env)
31
+ hash, request = {}, ::Rack::Request.new(env.dup)
32
32
 
33
33
  hash[:url] = extract_url(request)
34
34
  hash[:params] = extract_params(request)
@@ -3,9 +3,14 @@ module Honeybadger
3
3
  class Revision
4
4
  class << self
5
5
  def detect(root = Dir.pwd)
6
- from_heroku ||
6
+ revision = from_heroku ||
7
7
  from_capistrano(root) ||
8
8
  from_git
9
+
10
+ revision = revision.to_s.strip
11
+ return unless revision =~ /\S/
12
+
13
+ revision
9
14
  end
10
15
 
11
16
  private
@@ -21,12 +26,12 @@ module Honeybadger
21
26
  def from_capistrano(root)
22
27
  file = File.join(root, 'REVISION')
23
28
  return nil unless File.file?(file)
24
- File.read(file).strip rescue nil
29
+ File.read(file) rescue nil
25
30
  end
26
31
 
27
32
  def from_git
28
33
  return nil unless File.directory?('.git')
29
- `git rev-parse HEAD 2> #{File::NULL}`.strip rescue nil
34
+ `git rev-parse HEAD 2> #{File::NULL}` rescue nil
30
35
  end
31
36
  end
32
37
  end
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # The current String Honeybadger version.
3
- VERSION = '4.11.0'.freeze
3
+ VERSION = '4.12.2'.freeze
4
4
  end
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.11.0
4
+ version: 4.12.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-02-15 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email: