exception_handling 2.2.1 → 2.3.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +5 -0
  4. data/Gemfile +7 -6
  5. data/Gemfile.lock +26 -23
  6. data/README.md +0 -1
  7. data/Rakefile +4 -4
  8. data/config/exception_filters.yml +2 -3
  9. data/exception_handling.gemspec +12 -10
  10. data/lib/exception_handling/exception_catalog.rb +5 -4
  11. data/lib/exception_handling/exception_description.rb +28 -28
  12. data/lib/exception_handling/exception_info.rb +80 -72
  13. data/lib/exception_handling/honeybadger_callbacks.rb +41 -24
  14. data/lib/exception_handling/log_stub_error.rb +10 -8
  15. data/lib/exception_handling/mailer.rb +27 -48
  16. data/lib/exception_handling/methods.rb +15 -11
  17. data/lib/exception_handling/sensu.rb +7 -5
  18. data/lib/exception_handling/testing.rb +21 -19
  19. data/lib/exception_handling/version.rb +1 -1
  20. data/lib/exception_handling.rb +105 -200
  21. data/test/helpers/controller_helpers.rb +3 -1
  22. data/test/helpers/exception_helpers.rb +9 -0
  23. data/test/test_helper.rb +26 -21
  24. data/test/unit/exception_handling/exception_catalog_test.rb +15 -14
  25. data/test/unit/exception_handling/exception_description_test.rb +22 -31
  26. data/test/unit/exception_handling/exception_info_test.rb +76 -37
  27. data/test/unit/exception_handling/honeybadger_callbacks_test.rb +46 -9
  28. data/test/unit/exception_handling/log_error_stub_test.rb +6 -4
  29. data/test/unit/exception_handling/mailer_test.rb +8 -14
  30. data/test/unit/exception_handling/methods_test.rb +9 -6
  31. data/test/unit/exception_handling/sensu_test.rb +6 -4
  32. data/test/unit/exception_handling_test.rb +279 -364
  33. metadata +24 -24
  34. data/views/exception_handling/mailer/exception_notification.html.erb +0 -92
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_handling
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Kelley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-28 00:00:00.000000000 Z
11
+ date: 2020-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: eventmachine
14
+ name: actionmailer
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: activesupport
28
+ name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.2'
41
41
  - !ruby/object:Gem::Dependency
42
- name: actionpack
42
+ name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
@@ -53,33 +53,33 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '4.2'
55
55
  - !ruby/object:Gem::Dependency
56
- name: actionmailer
56
+ name: contextual_logger
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '4.2'
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '4.2'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: invoca-utils
70
+ name: eventmachine
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.0'
75
+ version: '1.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.0'
82
+ version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: hobo_support
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: contextual_logger
98
+ name: invoca-utils
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '0.0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '0.0'
111
111
  description: Exception handling logger/emailer
112
112
  email:
113
113
  - colindkelley@gmail.com
@@ -116,6 +116,7 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
+ - ".rubocop.yml"
119
120
  - ".ruby-version"
120
121
  - Gemfile
121
122
  - Gemfile.lock
@@ -150,7 +151,6 @@ files:
150
151
  - test/unit/exception_handling_test.rb
151
152
  - views/exception_handling/mailer/escalate_custom.html.erb
152
153
  - views/exception_handling/mailer/escalation_notification.html.erb
153
- - views/exception_handling/mailer/exception_notification.html.erb
154
154
  - views/exception_handling/mailer/log_parser_exception_notification.html.erb
155
155
  homepage: https://github.com/Invoca/exception_handling
156
156
  licenses: []
@@ -166,12 +166,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ">="
169
+ - - ">"
170
170
  - !ruby/object:Gem::Version
171
- version: '0'
171
+ version: 1.3.1
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.7.6
174
+ rubygems_version: 2.6.13
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Invoca's exception handling logger/emailer layer, based on exception_notifier.
@@ -1,92 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <title>Exception Email</title>
6
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7
- </head>
8
- <body>
9
-
10
- <% if @cleaned_data[:first_seen_at] %>
11
- <p> This exception occurred <%= @cleaned_data[:occurrences] %> times since <%= @cleaned_data[:first_seen_at] %>.</p>
12
- <% end %>
13
-
14
- <b>Error #:</b> <%= @cleaned_data[:timestamp] -%><br />
15
- <b>Server:</b> <%= @cleaned_data[:server].presence || '<i>hostname not set</i>'.html_safe -%><br />
16
- <% if @cleaned_data[:scm_revision] %>
17
- <b>Revision:</b> <%= @cleaned_data[:scm_revision] %><br />
18
- <% end %>
19
-
20
- <b>URL:</b><br />
21
- <% if (request = @cleaned_data[:request]) %>
22
- <%= request[:url] || '<i>no URL in request data</i>'.html_safe %> <br />
23
- Referred from: <%= @cleaned_data[:environment]['HTTP_REFERER'] || '<i>no referrer</i>'.html_safe -%><br/>
24
- <% else %>
25
- <i>no URL accessed</i>
26
- <% end %>
27
- <br />
28
- <br />
29
-
30
- <% if @cleaned_data[:notes] %>
31
- <b>Exception Notes:</b> (from config/exception.yml)<br />
32
- <%= @cleaned_data[:notes].gsub("\n","<br/>\n").gsub(/ {2,}/) { |spaces| '&nbsp;'*spaces.size }.html_safe %>
33
- <br />
34
- <br />
35
- <% end %>
36
-
37
-
38
- <b>User summary:</b><br />
39
- <% if (user_details = @cleaned_data[:user_details]) && ( user_details[:user] || user_details[:organization] ) %>
40
- User: <%= user_details[:user] %> (<%= user_details[:username] %>)<br />
41
- Organization: <%= h(user_details[:organization]).gsub("\n","<br/>\n").gsub(/ {2,}/) { |spaces| '&nbsp;'*spaces.size }.html_safe %> <br />
42
-
43
- <% if user_details[:impersonated_organization] %>
44
- <br />
45
- <b>Impersonating:</b><br />
46
- Organization: <%= user_details[:impersonated_organization] %>
47
- <% end %>
48
- <% else %>
49
- <i>No user logged in.</i>
50
- <% end %>
51
-
52
- <br />
53
- <br />
54
- <hr />
55
-
56
- <h3>Exception:</h3>
57
- <%= h(@cleaned_data[:error]).gsub("\n","<br/>\n").gsub(/ {2,}/) { |spaces| '&nbsp;'*spaces.size }.html_safe %>
58
-
59
- <br />
60
- <br />
61
-
62
- <h3>Where:</h3>
63
- <% location = @cleaned_data[:location] %>
64
- <%= "#{ h location[:controller]}##{ h location[:action]}<br />".html_safe if location && location[:controller] -%>
65
- <%= "#{ h location[:file]}, line #{ h location[:line]}<br />".html_safe if location && location[:file] -%>
66
-
67
- <% for section in ExceptionHandling::ExceptionInfo::SECTIONS %>
68
- <% section_value = @cleaned_data[section] %>
69
- <% if section_value %>
70
- <h3><%= section.to_s.capitalize -%>:</h3>
71
- <pre style="font-size: 12px; font-family: 'Courier New','Arial',sans-serif">
72
- <%= case section_value
73
- when Hash
74
- section_value[:to_s]
75
- when Array
76
- section_value.join( "\n" )
77
- when NilClass # omitted
78
- else
79
- if section_value.respond_to?(:to_s)
80
- section_value.to_s
81
- else
82
- raise "Unexpected value #{section_value.inspect} for section #{section}"
83
- end
84
- end
85
- -%>
86
- </pre>
87
- <% end %>
88
-
89
- <% end %>
90
-
91
- </body>
92
- </html>