exception_handling 2.6.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.jenkins/Jenkinsfile +24 -8
- data/.rspec +3 -0
- data/CHANGELOG.md +18 -1
- data/Gemfile +4 -4
- data/Gemfile.lock +66 -57
- data/Rakefile +7 -6
- data/gemfiles/rails_4.gemfile +4 -4
- data/gemfiles/rails_5.gemfile +4 -4
- data/gemfiles/rails_6.gemfile +4 -4
- data/lib/exception_handling.rb +5 -2
- data/lib/exception_handling/exception_info.rb +3 -6
- data/lib/exception_handling/log_stub_error.rb +2 -1
- data/lib/exception_handling/logging_methods.rb +27 -0
- data/lib/exception_handling/methods.rb +6 -53
- data/lib/exception_handling/testing.rb +20 -10
- data/lib/exception_handling/version.rb +1 -1
- data/{test → spec}/helpers/controller_helpers.rb +0 -0
- data/{test → spec}/helpers/exception_helpers.rb +2 -2
- data/{test → spec}/rake_test_warning_false.rb +0 -0
- data/{test/test_helper.rb → spec/spec_helper.rb} +50 -39
- data/spec/unit/exception_handling/exception_catalog_spec.rb +85 -0
- data/spec/unit/exception_handling/exception_description_spec.rb +82 -0
- data/{test/unit/exception_handling/exception_info_test.rb → spec/unit/exception_handling/exception_info_spec.rb} +118 -99
- data/{test/unit/exception_handling/honeybadger_callbacks_test.rb → spec/unit/exception_handling/honeybadger_callbacks_spec.rb} +20 -20
- data/{test/unit/exception_handling/log_error_stub_test.rb → spec/unit/exception_handling/log_error_stub_spec.rb} +38 -22
- data/spec/unit/exception_handling/logging_methods_spec.rb +38 -0
- data/{test/unit/exception_handling/mailer_test.rb → spec/unit/exception_handling/mailer_spec.rb} +17 -17
- data/spec/unit/exception_handling/methods_spec.rb +105 -0
- data/spec/unit/exception_handling/sensu_spec.rb +51 -0
- data/{test/unit/exception_handling_test.rb → spec/unit/exception_handling_spec.rb} +348 -329
- metadata +32 -28
- data/test/unit/exception_handling/exception_catalog_test.rb +0 -85
- data/test/unit/exception_handling/exception_description_test.rb +0 -82
- data/test/unit/exception_handling/methods_test.rb +0 -84
- data/test/unit/exception_handling/sensu_test.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 419ff3f511e22c7c1b257b68064f10b825a08b72cff086c2e3f6cfaeffaa8d74
|
4
|
+
data.tar.gz: 163ea2d99bb20d20fa1935a60f9d4b57de666439235274d9a02b340b662addf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7def333f20d79f5f8f2979f41d3c823675eca38ca0e31a3bf27b885cb1098fca6ab3ee147821de4ee8d519c29f7575d9c43ebae157d2f18c6ea2958bfb120f03
|
7
|
+
data.tar.gz: 81dbf1e1d1a8dee6f54a5f98227028a75d633a01d99fc70162d0d2e56dfd4d3e97e6a4103aae140e8a970ec38bae200603de3f8ffeaf3630ccc6add3e9121005
|
data/.gitignore
CHANGED
data/.jenkins/Jenkinsfile
CHANGED
@@ -36,42 +36,58 @@ pipeline {
|
|
36
36
|
stage('Appraisals') {
|
37
37
|
parallel {
|
38
38
|
stage('Current') {
|
39
|
+
environment {
|
40
|
+
JUNIT_OUTPUT = 'spec/reports/current'
|
41
|
+
}
|
42
|
+
|
39
43
|
steps {
|
40
|
-
sh
|
44
|
+
sh "bundle exec rspec --format RspecJunitFormatter --out ${JUNIT_OUTPUT}/rspec.xml"
|
41
45
|
}
|
42
46
|
|
43
47
|
post {
|
44
|
-
always { junit
|
48
|
+
always { junit "${JUNIT_OUTPUT}/*.xml" }
|
45
49
|
}
|
46
50
|
}
|
47
51
|
|
48
52
|
stage('Rails 4') {
|
53
|
+
environment {
|
54
|
+
JUNIT_OUTPUT = 'spec/reports/rails-4'
|
55
|
+
}
|
56
|
+
|
49
57
|
steps {
|
50
|
-
sh
|
58
|
+
sh "bundle exec appraisal rails-4 rspec --format RspecJunitFormatter --out ${JUNIT_OUTPUT}/rspec.xml"
|
51
59
|
}
|
52
60
|
|
53
61
|
post {
|
54
|
-
always { junit
|
62
|
+
always { junit "${JUNIT_OUTPUT}/*.xml" }
|
55
63
|
}
|
56
64
|
}
|
57
65
|
|
58
66
|
stage('Rails 5') {
|
67
|
+
environment {
|
68
|
+
JUNIT_OUTPUT = 'spec/reports/rails-5'
|
69
|
+
}
|
70
|
+
|
59
71
|
steps {
|
60
|
-
sh
|
72
|
+
sh "bundle exec appraisal rails-5 rspec --format RspecJunitFormatter --out ${JUNIT_OUTPUT}/rspec.xml"
|
61
73
|
}
|
62
74
|
|
63
75
|
post {
|
64
|
-
always { junit
|
76
|
+
always { junit "${JUNIT_OUTPUT}/*.xml" }
|
65
77
|
}
|
66
78
|
}
|
67
79
|
|
68
80
|
stage('Rails 6') {
|
81
|
+
environment {
|
82
|
+
JUNIT_OUTPUT = 'spec/reports/rails-6'
|
83
|
+
}
|
84
|
+
|
69
85
|
steps {
|
70
|
-
sh
|
86
|
+
sh "bundle exec appraisal rails-6 rspec --format RspecJunitFormatter --out ${JUNIT_OUTPUT}/rspec.xml"
|
71
87
|
}
|
72
88
|
|
73
89
|
post {
|
74
|
-
always { junit
|
90
|
+
always { junit "${JUNIT_OUTPUT}/*.xml" }
|
75
91
|
}
|
76
92
|
}
|
77
93
|
}
|
data/.rspec
ADDED
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,21 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
5
5
|
Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [2.
|
7
|
+
## [2.8.0] - Unreleased
|
8
|
+
### Deprecated
|
9
|
+
- Deprecated Email Escalation Methods: `escalate_to_production_support`, `escalate_error`, `escalate_warning`, `ensure_escalation`
|
10
|
+
|
11
|
+
## [2.7.0] - 2020-10-14
|
12
|
+
### Added
|
13
|
+
- Added `LoggingMethods` as a replacement for `Methods` without setting controller or checking for long controller action.
|
14
|
+
### Deprecated
|
15
|
+
- Deprecated `Methods` in favor of `LoggingMethods`.
|
16
|
+
|
17
|
+
## [2.6.1] - 2020-10-14
|
18
|
+
### Fixed
|
19
|
+
- Fixed honeybadger_context_data to always merge `current_context_for_thread`, even if `log_context:` is passed as `nil`.
|
20
|
+
|
21
|
+
## [2.6.0] - 2020-08-26
|
8
22
|
### Changed
|
9
23
|
- Calling `log_warning` will now log with Severity::WARNING rather than FATAL.
|
10
24
|
- Reordered the logging to put the exception class next to the message.
|
@@ -42,6 +56,9 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
|
|
42
56
|
### Changed
|
43
57
|
- No longer depends on hobo_support. Uses invoca-utils 0.3 instead.
|
44
58
|
|
59
|
+
[2.8.0]: https://github.com/Invoca/exception_handling/compare/v2.7.0...v2.8.0
|
60
|
+
[2.7.0]: https://github.com/Invoca/exception_handling/compare/v2.6.1...v2.7.0
|
61
|
+
[2.6.1]: https://github.com/Invoca/exception_handling/compare/v2.6.0...v2.6.1
|
45
62
|
[2.6.0]: https://github.com/Invoca/exception_handling/compare/v2.5.0...v2.6.0
|
46
63
|
[2.5.0]: https://github.com/Invoca/exception_handling/compare/v2.4.4...v2.5.0
|
47
64
|
[2.4.4]: https://github.com/Invoca/exception_handling/compare/v2.4.3...v2.4.4
|
data/Gemfile
CHANGED
@@ -6,10 +6,10 @@ gemspec
|
|
6
6
|
|
7
7
|
gem 'appraisal', '~> 2.2'
|
8
8
|
gem 'honeybadger', '3.3.1-1', git: 'git@github.com:Invoca/honeybadger-ruby', ref: 'bb5f2b8a86e4147c38a6270d39ad610fab4dd5e6'
|
9
|
-
gem "minitest"
|
10
|
-
gem "minitest-reporters"
|
11
9
|
gem 'pry'
|
10
|
+
gem 'pry-byebug'
|
12
11
|
gem 'rake'
|
13
|
-
gem '
|
12
|
+
gem 'rspec'
|
13
|
+
gem 'rspec_junit_formatter'
|
14
14
|
gem 'rubocop'
|
15
|
-
gem '
|
15
|
+
gem 'test-unit'
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ GIT
|
|
8
8
|
PATH
|
9
9
|
remote: .
|
10
10
|
specs:
|
11
|
-
exception_handling (2.
|
11
|
+
exception_handling (2.8.0)
|
12
12
|
actionmailer (>= 4.2, < 7.0)
|
13
13
|
actionpack (>= 4.2, < 7.0)
|
14
14
|
activesupport (>= 4.2, < 7.0)
|
@@ -19,51 +19,53 @@ PATH
|
|
19
19
|
GEM
|
20
20
|
remote: https://rubygems.org/
|
21
21
|
specs:
|
22
|
-
actionmailer (
|
23
|
-
actionpack (=
|
24
|
-
actionview (=
|
25
|
-
activejob (=
|
22
|
+
actionmailer (6.0.3.4)
|
23
|
+
actionpack (= 6.0.3.4)
|
24
|
+
actionview (= 6.0.3.4)
|
25
|
+
activejob (= 6.0.3.4)
|
26
26
|
mail (~> 2.5, >= 2.5.4)
|
27
|
-
rails-dom-testing (~>
|
28
|
-
actionpack (
|
29
|
-
actionview (=
|
30
|
-
activesupport (=
|
31
|
-
rack (~>
|
32
|
-
rack-test (
|
33
|
-
rails-dom-testing (~>
|
34
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
35
|
-
actionview (
|
36
|
-
activesupport (=
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
actionpack (6.0.3.4)
|
29
|
+
actionview (= 6.0.3.4)
|
30
|
+
activesupport (= 6.0.3.4)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
32
|
+
rack-test (>= 0.6.3)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actionview (6.0.3.4)
|
36
|
+
activesupport (= 6.0.3.4)
|
37
37
|
builder (~> 3.1)
|
38
|
-
|
39
|
-
rails-dom-testing (~>
|
40
|
-
rails-html-sanitizer (~> 1.
|
41
|
-
activejob (
|
42
|
-
activesupport (=
|
43
|
-
globalid (>= 0.3.
|
44
|
-
activesupport (
|
45
|
-
|
38
|
+
erubi (~> 1.4)
|
39
|
+
rails-dom-testing (~> 2.0)
|
40
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
41
|
+
activejob (6.0.3.4)
|
42
|
+
activesupport (= 6.0.3.4)
|
43
|
+
globalid (>= 0.3.6)
|
44
|
+
activesupport (6.0.3.4)
|
45
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
46
|
+
i18n (>= 0.7, < 2)
|
46
47
|
minitest (~> 5.1)
|
47
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
48
48
|
tzinfo (~> 1.1)
|
49
|
-
|
49
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
50
50
|
appraisal (2.2.0)
|
51
51
|
bundler
|
52
52
|
rake
|
53
53
|
thor (>= 0.14.0)
|
54
54
|
ast (2.4.0)
|
55
|
-
builder (3.2.
|
55
|
+
builder (3.2.4)
|
56
|
+
byebug (11.1.3)
|
56
57
|
coderay (1.1.2)
|
57
|
-
concurrent-ruby (1.1.
|
58
|
-
contextual_logger (0.
|
58
|
+
concurrent-ruby (1.1.7)
|
59
|
+
contextual_logger (0.11.0)
|
59
60
|
activesupport
|
60
61
|
json
|
61
62
|
crass (1.0.6)
|
62
|
-
|
63
|
+
diff-lcs (1.4.4)
|
64
|
+
erubi (1.9.0)
|
63
65
|
eventmachine (1.2.7)
|
64
66
|
globalid (0.4.2)
|
65
67
|
activesupport (>= 4.2.0)
|
66
|
-
i18n (
|
68
|
+
i18n (1.8.5)
|
67
69
|
concurrent-ruby (~> 1.0)
|
68
70
|
invoca-utils (0.4.1)
|
69
71
|
jaro_winkler (1.5.3)
|
@@ -76,34 +78,44 @@ GEM
|
|
76
78
|
method_source (0.9.2)
|
77
79
|
mini_mime (1.0.2)
|
78
80
|
mini_portile2 (2.4.0)
|
79
|
-
minitest (5.
|
80
|
-
minitest-reporters (1.0.20)
|
81
|
-
ansi
|
82
|
-
builder
|
83
|
-
minitest (>= 5.0)
|
84
|
-
ruby-progressbar
|
81
|
+
minitest (5.14.2)
|
85
82
|
nokogiri (1.10.10)
|
86
83
|
mini_portile2 (~> 2.4.0)
|
87
84
|
parallel (1.17.0)
|
88
85
|
parser (2.6.3.0)
|
89
86
|
ast (~> 2.4.0)
|
87
|
+
power_assert (1.2.0)
|
90
88
|
pry (0.12.2)
|
91
89
|
coderay (~> 1.1.0)
|
92
90
|
method_source (~> 0.9.0)
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
91
|
+
pry-byebug (3.8.0)
|
92
|
+
byebug (~> 11.0)
|
93
|
+
pry (~> 0.10)
|
94
|
+
rack (2.2.3)
|
95
|
+
rack-test (1.1.0)
|
96
|
+
rack (>= 1.0, < 3)
|
97
|
+
rails-dom-testing (2.0.3)
|
98
|
+
activesupport (>= 4.2.0)
|
99
|
+
nokogiri (>= 1.6)
|
102
100
|
rails-html-sanitizer (1.3.0)
|
103
101
|
loofah (~> 2.3)
|
104
102
|
rainbow (3.0.0)
|
105
103
|
rake (13.0.1)
|
106
|
-
|
104
|
+
rspec (3.9.0)
|
105
|
+
rspec-core (~> 3.9.0)
|
106
|
+
rspec-expectations (~> 3.9.0)
|
107
|
+
rspec-mocks (~> 3.9.0)
|
108
|
+
rspec-core (3.9.2)
|
109
|
+
rspec-support (~> 3.9.3)
|
110
|
+
rspec-expectations (3.9.2)
|
111
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
112
|
+
rspec-support (~> 3.9.0)
|
113
|
+
rspec-mocks (3.9.1)
|
114
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
115
|
+
rspec-support (~> 3.9.0)
|
116
|
+
rspec-support (3.9.3)
|
117
|
+
rspec_junit_formatter (0.4.1)
|
118
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
107
119
|
rubocop (0.74.0)
|
108
120
|
jaro_winkler (~> 1.5.1)
|
109
121
|
parallel (~> 1.10)
|
@@ -112,17 +124,14 @@ GEM
|
|
112
124
|
ruby-progressbar (~> 1.7)
|
113
125
|
unicode-display_width (>= 1.4.0, < 1.7)
|
114
126
|
ruby-progressbar (1.10.1)
|
115
|
-
|
116
|
-
|
117
|
-
shoulda-matchers (~> 3.0)
|
118
|
-
shoulda-context (1.2.2)
|
119
|
-
shoulda-matchers (3.1.3)
|
120
|
-
activesupport (>= 4.0.0)
|
127
|
+
test-unit (3.3.6)
|
128
|
+
power_assert
|
121
129
|
thor (1.0.1)
|
122
130
|
thread_safe (0.3.6)
|
123
|
-
tzinfo (1.2.
|
131
|
+
tzinfo (1.2.7)
|
124
132
|
thread_safe (~> 0.1)
|
125
133
|
unicode-display_width (1.6.0)
|
134
|
+
zeitwerk (2.4.0)
|
126
135
|
|
127
136
|
PLATFORMS
|
128
137
|
ruby
|
@@ -131,13 +140,13 @@ DEPENDENCIES
|
|
131
140
|
appraisal (~> 2.2)
|
132
141
|
exception_handling!
|
133
142
|
honeybadger (= 3.3.1.pre.1)!
|
134
|
-
minitest
|
135
|
-
minitest-reporters
|
136
143
|
pry
|
144
|
+
pry-byebug
|
137
145
|
rake
|
138
|
-
|
146
|
+
rspec
|
147
|
+
rspec_junit_formatter
|
139
148
|
rubocop
|
140
|
-
|
149
|
+
test-unit
|
141
150
|
|
142
151
|
BUNDLED WITH
|
143
152
|
1.17.3
|
data/Rakefile
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require "bundler/gem_tasks"
|
5
4
|
require 'rake/testtask'
|
5
|
+
require "bundler/gem_tasks"
|
6
6
|
|
7
|
-
require_relative '
|
8
|
-
|
9
|
-
task default: :test
|
7
|
+
require_relative 'spec/rake_test_warning_false'
|
10
8
|
|
11
|
-
|
12
|
-
|
9
|
+
desc "run rspec unit tests"
|
10
|
+
begin
|
11
|
+
require 'rspec/core/rake_task'
|
12
|
+
RSpec::Core::RakeTask.new(:rspec)
|
13
13
|
end
|
14
14
|
|
15
|
+
task default: :rspec
|
data/gemfiles/rails_4.gemfile
CHANGED
@@ -4,13 +4,13 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "appraisal", "~> 2.2"
|
6
6
|
gem "honeybadger", "3.3.1-1", git: "git@github.com:Invoca/honeybadger-ruby", ref: "bb5f2b8a86e4147c38a6270d39ad610fab4dd5e6"
|
7
|
-
gem "minitest"
|
8
|
-
gem "minitest-reporters"
|
9
7
|
gem "pry"
|
8
|
+
gem "pry-byebug"
|
10
9
|
gem "rake"
|
11
|
-
gem "
|
10
|
+
gem "rspec"
|
11
|
+
gem "rspec_junit_formatter"
|
12
12
|
gem "rubocop"
|
13
|
-
gem "
|
13
|
+
gem "test-unit"
|
14
14
|
gem "actionmailer", "~> 4.2"
|
15
15
|
gem "actionpack", "~> 4.2"
|
16
16
|
gem "activesupport", "~> 4.2"
|
data/gemfiles/rails_5.gemfile
CHANGED
@@ -4,13 +4,13 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "appraisal", "~> 2.2"
|
6
6
|
gem "honeybadger", "3.3.1-1", git: "git@github.com:Invoca/honeybadger-ruby", ref: "bb5f2b8a86e4147c38a6270d39ad610fab4dd5e6"
|
7
|
-
gem "minitest"
|
8
|
-
gem "minitest-reporters"
|
9
7
|
gem "pry"
|
8
|
+
gem "pry-byebug"
|
10
9
|
gem "rake"
|
11
|
-
gem "
|
10
|
+
gem "rspec"
|
11
|
+
gem "rspec_junit_formatter"
|
12
12
|
gem "rubocop"
|
13
|
-
gem "
|
13
|
+
gem "test-unit"
|
14
14
|
gem "actionmailer", "~> 5.2"
|
15
15
|
gem "actionpack", "~> 5.2"
|
16
16
|
gem "activesupport", "~> 5.2"
|
data/gemfiles/rails_6.gemfile
CHANGED
@@ -4,13 +4,13 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "appraisal", "~> 2.2"
|
6
6
|
gem "honeybadger", "3.3.1-1", git: "git@github.com:Invoca/honeybadger-ruby", ref: "bb5f2b8a86e4147c38a6270d39ad610fab4dd5e6"
|
7
|
-
gem "minitest"
|
8
|
-
gem "minitest-reporters"
|
9
7
|
gem "pry"
|
8
|
+
gem "pry-byebug"
|
10
9
|
gem "rake"
|
11
|
-
gem "
|
10
|
+
gem "rspec"
|
11
|
+
gem "rspec_junit_formatter"
|
12
12
|
gem "rubocop"
|
13
|
-
gem "
|
13
|
+
gem "test-unit"
|
14
14
|
gem "actionmailer", "~> 6.0"
|
15
15
|
gem "actionpack", "~> 6.0"
|
16
16
|
gem "activesupport", "~> 6.0"
|
data/lib/exception_handling.rb
CHANGED
@@ -29,6 +29,8 @@ module ExceptionHandling # never included
|
|
29
29
|
AUTHENTICATION_HEADERS = ['HTTP_AUTHORIZATION', 'X-HTTP_AUTHORIZATION', 'X_HTTP_AUTHORIZATION', 'REDIRECT_X_HTTP_AUTHORIZATION'].freeze
|
30
30
|
HONEYBADGER_STATUSES = [:success, :failure, :skipped].freeze
|
31
31
|
|
32
|
+
Deprecation3_0 = ActiveSupport::Deprecation.new('3.0', 'exception_handling')
|
33
|
+
|
32
34
|
class << self
|
33
35
|
|
34
36
|
#
|
@@ -54,8 +56,6 @@ module ExceptionHandling # never included
|
|
54
56
|
@logger or raise ArgumentError, "You must assign a value to #{name}.logger"
|
55
57
|
end
|
56
58
|
|
57
|
-
Deprecation3_0 = ActiveSupport::Deprecation.new('3.0', 'exception_handling')
|
58
|
-
|
59
59
|
def logger=(logger)
|
60
60
|
@logger = if logger.nil? || logger.is_a?(ContextualLogger::LoggerMixin)
|
61
61
|
logger
|
@@ -348,6 +348,9 @@ module ExceptionHandling # never included
|
|
348
348
|
nil
|
349
349
|
end
|
350
350
|
|
351
|
+
deprecate :escalate_to_production_support, :escalate_error, :escalate_warning, :ensure_escalation,
|
352
|
+
deprecator: ActiveSupport::Deprecation.new('3.0', 'ExceptionHandling')
|
353
|
+
|
351
354
|
def alert_warning(exception_or_string, alert_name, exception_context, log_context)
|
352
355
|
ex = make_exception(exception_or_string)
|
353
356
|
log_error(ex, exception_context, **log_context)
|
@@ -57,9 +57,8 @@ module ExceptionHandling
|
|
57
57
|
@timestamp = timestamp
|
58
58
|
@controller = controller || controller_from_context(exception_context)
|
59
59
|
@data_callback = data_callback
|
60
|
-
|
61
|
-
|
62
|
-
end
|
60
|
+
# merge into the surrounding context just like ContextualLogger does when logging
|
61
|
+
@merged_log_context = ExceptionHandling.logger.current_context_for_thread.deep_merge(log_context || {})
|
63
62
|
end
|
64
63
|
|
65
64
|
def data
|
@@ -273,13 +272,11 @@ module ExceptionHandling
|
|
273
272
|
data[:exception_context] = deep_clean_hash(@exception_context) if @exception_context.present?
|
274
273
|
data[:log_context] = @merged_log_context
|
275
274
|
unstringify_sections(data)
|
276
|
-
|
275
|
+
HONEYBADGER_CONTEXT_SECTIONS.each_with_object({}) do |section, context|
|
277
276
|
if data[section].present?
|
278
277
|
context[section] = data[section]
|
279
278
|
end
|
280
|
-
context
|
281
279
|
end
|
282
|
-
context_data
|
283
280
|
end
|
284
281
|
end
|
285
282
|
end
|