exception_handling 2.8.0 → 2.8.1.pre.0

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: 419ff3f511e22c7c1b257b68064f10b825a08b72cff086c2e3f6cfaeffaa8d74
4
- data.tar.gz: 163ea2d99bb20d20fa1935a60f9d4b57de666439235274d9a02b340b662addf5
3
+ metadata.gz: 18b5943731438b58f95dd8bbca259e16e7ab96de2f2f8fda23ca3ea31bd4ee45
4
+ data.tar.gz: 0ecc45cf4314eaea85045c9a5eff37e2b97ae2dee157dc20d8b3232d72bb0845
5
5
  SHA512:
6
- metadata.gz: 7def333f20d79f5f8f2979f41d3c823675eca38ca0e31a3bf27b885cb1098fca6ab3ee147821de4ee8d519c29f7575d9c43ebae157d2f18c6ea2958bfb120f03
7
- data.tar.gz: 81dbf1e1d1a8dee6f54a5f98227028a75d633a01d99fc70162d0d2e56dfd4d3e97e6a4103aae140e8a970ec38bae200603de3f8ffeaf3630ccc6add3e9121005
6
+ metadata.gz: a315ec480e19c9e7f289c85daadd2ea4866f91be69218fa64c0ccfecf979ec85e4ea2419fd84210271dbd45c577e7721af17d402b3ba0b1cad9adef0c15d8814
7
+ data.tar.gz: 12e47f2b180b823e689e579614455c280bc60bf2d5622504ec609d6eb6605dd65d82f4bcff1c52a3997db186b2077646c0a38a78bf55ff7bbd949cb1a7c251b2
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- exception_handling (2.8.0)
11
+ exception_handling (2.8.1.pre.0)
12
12
  actionmailer (>= 4.2, < 7.0)
13
13
  actionpack (>= 4.2, < 7.0)
14
14
  activesupport (>= 4.2, < 7.0)
@@ -61,7 +61,7 @@ GEM
61
61
  json
62
62
  crass (1.0.6)
63
63
  diff-lcs (1.4.4)
64
- erubi (1.9.0)
64
+ erubi (1.10.0)
65
65
  eventmachine (1.2.7)
66
66
  globalid (0.4.2)
67
67
  activesupport (>= 4.2.0)
@@ -128,10 +128,10 @@ GEM
128
128
  power_assert
129
129
  thor (1.0.1)
130
130
  thread_safe (0.3.6)
131
- tzinfo (1.2.7)
131
+ tzinfo (1.2.8)
132
132
  thread_safe (~> 0.1)
133
133
  unicode-display_width (1.6.0)
134
- zeitwerk (2.4.0)
134
+ zeitwerk (2.4.1)
135
135
 
136
136
  PLATFORMS
137
137
  ruby
@@ -82,9 +82,10 @@ module ExceptionHandling
82
82
  end
83
83
 
84
84
  def controller_name
85
- @controller_name ||= if @controller
86
- @controller.request.parameters.with_indifferent_access[:controller]
87
- end.to_s
85
+ @controller_name ||= (
86
+ @merged_log_context[:honeybadger_grouping] ||
87
+ (@controller && @controller.request.parameters.with_indifferent_access[:controller])
88
+ ).to_s
88
89
  end
89
90
 
90
91
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExceptionHandling
4
- VERSION = '2.8.0'
4
+ VERSION = '2.8.1.pre.0'
5
5
  end
@@ -361,6 +361,26 @@ module ExceptionHandling
361
361
  }
362
362
  end
363
363
 
364
+ it "returns honeybadger_grouping from the log context" do
365
+ allow(ExceptionHandling.logger).to receive(:current_context_for_thread).and_return({ honeybadger_grouping: 'Group 1' })
366
+ exception_info = ExceptionInfo.new(@exception, @exception_context, @timestamp)
367
+
368
+ expect(exception_info.controller_name).to eq('Group 1')
369
+ end
370
+
371
+ it "returns honeybadger_grouping from log context even if controller is defined" do
372
+ allow(ExceptionHandling.logger).to receive(:current_context_for_thread).and_return({ honeybadger_grouping: 'Group 1' })
373
+
374
+ env = { server: 'fe98' }
375
+ parameters = { controller: 'some_controller' }
376
+ session = { username: 'smith' }
377
+ request_uri = "host/path"
378
+ controller = create_dummy_controller(env, parameters, session, request_uri)
379
+ exception_info = ExceptionInfo.new(@exception, @exception_context, @timestamp, controller: controller)
380
+
381
+ expect(exception_info.controller_name).to eq('Group 1')
382
+ end
383
+
364
384
  it "return controller_name when controller is present" do
365
385
  env = { server: 'fe98' }
366
386
  parameters = { controller: 'some_controller' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_handling
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1.pre.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-19 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -183,9 +183,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - ">="
186
+ - - ">"
187
187
  - !ruby/object:Gem::Version
188
- version: '0'
188
+ version: 1.3.1
189
189
  requirements: []
190
190
  rubygems_version: 3.0.3
191
191
  signing_key: