bugsnag 6.7.1 → 6.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/VERSION +1 -1
- data/bugsnag.gemspec +1 -1
- data/issue_template.md +43 -13
- data/lib/bugsnag.rb +24 -18
- data/lib/bugsnag/report.rb +1 -1
- data/spec/report_spec.rb +15 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a0ddb8da5fb920f1f434e58e955d26b979debe8
|
4
|
+
data.tar.gz: 65de67a4ae0dbb7356bd893100e7889d608cb8bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83327beda70eccb521332bdac2fd0c6b96eff182c508bdfacf67ba5465ceac51bb5c3f5df26ab5294c8c6051efc721eda05d9862d561de0a5b1bfe0184b746ad
|
7
|
+
data.tar.gz: cb10e69935a1682cba5aedcceee811097626a95a96a394bcbab0f22aaa77d427fd8ec00d1788a210b0c3354d4b1a8ea567066758fc3df01c1b909496a42a5fb1
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.7.
|
1
|
+
6.7.2
|
data/bugsnag.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
|
8
8
|
s.description = "Ruby notifier for bugsnag.com"
|
9
9
|
s.summary = "Ruby notifier for bugsnag.com"
|
10
|
-
s.homepage = "
|
10
|
+
s.homepage = "https://github.com/bugsnag/bugsnag-ruby"
|
11
11
|
s.licenses = ["MIT"]
|
12
12
|
|
13
13
|
s.files = `git ls-files`.split("\n").reject {|file| file.start_with? "example/"}
|
data/issue_template.md
CHANGED
@@ -1,18 +1,48 @@
|
|
1
|
-
###
|
2
|
-
|
1
|
+
### Description
|
2
|
+
<!-- A quick description of what you're trying to accomplish -->
|
3
3
|
|
4
|
-
###
|
5
|
-
|
4
|
+
### Issue
|
5
|
+
<!--
|
6
|
+
What went wrong? (If this issue is a general question or a proposed change,
|
7
|
+
feel free to delete this and subsequent sections.
|
8
|
+
-->
|
6
9
|
|
7
|
-
###
|
8
|
-
*[Insert reproduction steps (if known)]*
|
10
|
+
### Environment
|
9
11
|
|
10
|
-
|
11
|
-
*[Insert version information]*
|
12
|
+
Library versions:
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
<!--
|
15
|
+
Paste the output of this command into the code block below:
|
16
|
+
bundle list | grep -E "(bugsnag|rails|sidekiq|que|sinatra|resque|shoryuken|mailman|delayed_job)"
|
17
|
+
-->
|
18
|
+
```
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
```
|
21
|
+
|
22
|
+
- OS / OS version:
|
23
|
+
- debug mode or production?:
|
24
|
+
|
25
|
+
<!--
|
26
|
+
Below are a few approaches you might take to communicate the issue, in
|
27
|
+
descending order of awesomeness. Please choose one and feel free to delete
|
28
|
+
the others from this template.
|
29
|
+
-->
|
30
|
+
### Example Repo
|
31
|
+
|
32
|
+
- [ ] Create a minimal repository that can reproduce the issue after running
|
33
|
+
`bundle install` and `rackup` (or `rails server`, or `ruby some-script.rb`,
|
34
|
+
etc)
|
35
|
+
- [ ] Link to it here:
|
36
|
+
|
37
|
+
### Example code snippet
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
require 'bugsnag'
|
41
|
+
|
42
|
+
# (Insert code sample to reproduce the problem)
|
43
|
+
```
|
44
|
+
|
45
|
+
<!-- Error messages, if any -->
|
46
|
+
```
|
47
|
+
|
48
|
+
```
|
data/lib/bugsnag.rb
CHANGED
@@ -32,6 +32,8 @@ module Bugsnag
|
|
32
32
|
LOCK = Mutex.new
|
33
33
|
INTEGRATIONS = [:resque, :sidekiq, :mailman, :delayed_job, :shoryuken, :que]
|
34
34
|
|
35
|
+
NIL_EXCEPTION_DESCRIPTION = "'nil' was notified as an exception"
|
36
|
+
|
35
37
|
class << self
|
36
38
|
##
|
37
39
|
# Configure the Bugsnag notifier application-wide settings.
|
@@ -53,25 +55,9 @@ module Bugsnag
|
|
53
55
|
auto_notify = false
|
54
56
|
end
|
55
57
|
|
56
|
-
|
57
|
-
configuration.debug("Not notifying because auto_notify is disabled")
|
58
|
-
return
|
59
|
-
end
|
60
|
-
|
61
|
-
if !configuration.valid_api_key?
|
62
|
-
configuration.debug("Not notifying due to an invalid api_key")
|
63
|
-
return
|
64
|
-
end
|
58
|
+
return unless deliver_notification?(exception, auto_notify)
|
65
59
|
|
66
|
-
if
|
67
|
-
configuration.debug("Not notifying due to notify_release_stages :#{configuration.notify_release_stages.inspect}")
|
68
|
-
return
|
69
|
-
end
|
70
|
-
|
71
|
-
if exception.respond_to?(:skip_bugsnag) && exception.skip_bugsnag
|
72
|
-
configuration.debug("Not notifying due to skip_bugsnag flag")
|
73
|
-
return
|
74
|
-
end
|
60
|
+
exception = NIL_EXCEPTION_DESCRIPTION if exception.nil?
|
75
61
|
|
76
62
|
report = Report.new(exception, configuration, auto_notify)
|
77
63
|
|
@@ -176,6 +162,26 @@ module Bugsnag
|
|
176
162
|
end
|
177
163
|
end
|
178
164
|
|
165
|
+
private
|
166
|
+
|
167
|
+
def deliver_notification?(exception, auto_notify)
|
168
|
+
reason = abort_reason(exception, auto_notify)
|
169
|
+
configuration.debug(reason) unless reason.nil?
|
170
|
+
reason.nil?
|
171
|
+
end
|
172
|
+
|
173
|
+
def abort_reason(exception, auto_notify)
|
174
|
+
if !configuration.auto_notify && auto_notify
|
175
|
+
"Not notifying because auto_notify is disabled"
|
176
|
+
elsif !configuration.valid_api_key?
|
177
|
+
"Not notifying due to an invalid api_key"
|
178
|
+
elsif !configuration.should_notify_release_stage?
|
179
|
+
"Not notifying due to notify_release_stages :#{configuration.notify_release_stages.inspect}"
|
180
|
+
elsif exception.respond_to?(:skip_bugsnag) && exception.skip_bugsnag
|
181
|
+
"Not notifying due to skip_bugsnag flag"
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
179
185
|
# Check if the API key is valid and warn (once) if it is not
|
180
186
|
def check_key_valid
|
181
187
|
@key_warning = false unless defined?(@key_warning)
|
data/lib/bugsnag/report.rb
CHANGED
@@ -6,7 +6,7 @@ module Bugsnag
|
|
6
6
|
class Report
|
7
7
|
NOTIFIER_NAME = "Ruby Bugsnag Notifier"
|
8
8
|
NOTIFIER_VERSION = Bugsnag::VERSION
|
9
|
-
NOTIFIER_URL = "
|
9
|
+
NOTIFIER_URL = "https://www.bugsnag.com"
|
10
10
|
|
11
11
|
UNHANDLED_EXCEPTION = "unhandledException"
|
12
12
|
UNHANDLED_EXCEPTION_MIDDLEWARE = "unhandledExceptionMiddleware"
|
data/spec/report_spec.rb
CHANGED
@@ -1045,6 +1045,21 @@ describe Bugsnag::Report do
|
|
1045
1045
|
expect(Bugsnag).not_to have_sent_notification
|
1046
1046
|
end
|
1047
1047
|
|
1048
|
+
it 'uses an appropriate message if nil is notified' do
|
1049
|
+
Bugsnag.notify(nil)
|
1050
|
+
expect(Bugsnag).to have_sent_notification{ |payload, headers|
|
1051
|
+
event = payload["events"][0]
|
1052
|
+
exception = event["exceptions"][0]
|
1053
|
+
expect(exception["errorClass"]).to eq("RuntimeError")
|
1054
|
+
expect(exception["message"]).to eq("'nil' was notified as an exception")
|
1055
|
+
|
1056
|
+
stacktrace = exception["stacktrace"][0]
|
1057
|
+
expect(stacktrace["lineNumber"]).to eq(1049)
|
1058
|
+
expect(stacktrace["file"]).to end_with("spec/report_spec.rb")
|
1059
|
+
expect(stacktrace["code"]["1048"]).to eq(" it 'uses an appropriate message if nil is notified' do")
|
1060
|
+
expect(stacktrace["code"]["1049"]).to eq(" Bugsnag.notify(nil)")
|
1061
|
+
}
|
1062
|
+
end
|
1048
1063
|
|
1049
1064
|
if defined?(JRUBY_VERSION)
|
1050
1065
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.7.
|
4
|
+
version: 6.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -131,7 +131,7 @@ files:
|
|
131
131
|
- spec/session_tracker_spec.rb
|
132
132
|
- spec/spec_helper.rb
|
133
133
|
- spec/stacktrace_spec.rb
|
134
|
-
homepage:
|
134
|
+
homepage: https://github.com/bugsnag/bugsnag-ruby
|
135
135
|
licenses:
|
136
136
|
- MIT
|
137
137
|
metadata: {}
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.6.
|
154
|
+
rubygems_version: 2.6.11
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Ruby notifier for bugsnag.com
|