Skip to content

Commit

Permalink
Merge pull request #502 from bugsnag/v6.10.0
Browse files Browse the repository at this point in the history
v6.10.0 Release
  • Loading branch information
Cawllec authored Dec 5, 2018
2 parents c8938c9 + b84d543 commit 17a6906
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 28 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Changelog
=========

## 6.10.0 (05 Dec 2018)

### Enhancements

* Add SignalException to our default ignored classes
| [#479](https://github.com/bugsnag/bugsnag-ruby/pull/479)
| [Toby Hsieh](https://github.com/tobyhs)

* Include Bugsnag frames, marked out of project
| [#497](https://github.com/bugsnag/bugsnag-ruby/pull/497)

### Fixes

* Ensure Sidekiq request data is always attached to notifications
| [#495](https://github.com/bugsnag/bugsnag-ruby/pull/495)

## 6.9.0 (12 Nov 2018)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.9.0
6.10.0
6 changes: 3 additions & 3 deletions lib/bugsnag/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def initialize
self.auto_capture_sessions = false
self.session_endpoint = DEFAULT_SESSION_ENDPOINT

# SystemExit and Interrupt are common Exception types seen with successful
# exits and are not automatically reported to Bugsnag
self.ignore_classes = Set.new([SystemExit, Interrupt])
# SystemExit and SignalException are common Exception types seen with
# successful exits and are not automatically reported to Bugsnag
self.ignore_classes = Set.new([SystemExit, SignalException])

# Read the API key from the environment
self.api_key = ENV["BUGSNAG_API_KEY"]
Expand Down
1 change: 0 additions & 1 deletion lib/bugsnag/integrations/mailman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def call(mail)
Bugsnag.configuration.set_request_data :mailman_msg, mail.to_s
yield
rescue Exception => ex
raise ex if [Interrupt, SystemExit, SignalException].include? ex.class
Bugsnag.notify(ex, true) do |report|
report.severity = "error"
report.severity_reason = {
Expand Down
14 changes: 6 additions & 8 deletions lib/bugsnag/integrations/shoryuken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ def call(_, queue, _, body)

yield
rescue Exception => ex
unless [Interrupt, SystemExit, SignalException].include?(ex.class)
Bugsnag.notify(ex, true) do |report|
report.severity = "error"
report.severity_reason = {
:type => Bugsnag::Report::UNHANDLED_EXCEPTION_MIDDLEWARE,
:attributes => Bugsnag::Shoryuken::FRAMEWORK_ATTRIBUTES
}
end
Bugsnag.notify(ex, true) do |report|
report.severity = "error"
report.severity_reason = {
:type => Bugsnag::Report::UNHANDLED_EXCEPTION_MIDDLEWARE,
:attributes => Bugsnag::Shoryuken::FRAMEWORK_ATTRIBUTES
}
end
raise
ensure
Expand Down
1 change: 0 additions & 1 deletion lib/bugsnag/integrations/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def call(worker, msg, queue)
end

def self.notify(exception)
return if [Interrupt, SystemExit, SignalException].include? exception.class
Bugsnag.notify(exception, true) do |report|
report.severity = "error"
report.severity_reason = {
Expand Down
2 changes: 1 addition & 1 deletion spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def debug(name, &block)
end

it "should have exit exception classes ignored by default" do
expect(subject.ignore_classes).to eq(Set.new([SystemExit, Interrupt]))
expect(subject.ignore_classes).to eq(Set.new([SystemExit, SignalException]))
end

end
35 changes: 22 additions & 13 deletions spec/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,27 @@ def gloops
end

it "sets correct severity and reason for specific error classes" do
Bugsnag.notify(SignalException.new("TERM"))
expect(Bugsnag).to have_sent_notification{ |payload, headers|
event = get_event_from_payload(payload)
expect(event["unhandled"]).to be false
expect(event["severity"]).to eq("info")
expect(event["severityReason"]).to eq({
"type" => "errorClass",
"attributes" => {
"errorClass" => "SignalException"
}
})
}
original_ignore_classes = Bugsnag.configuration.ignore_classes

begin
# The default ignore_classes includes SignalException, so we need to
# temporarily set it to something else.
Bugsnag.configuration.ignore_classes = Set[SystemExit]
Bugsnag.notify(SignalException.new("TERM"))
expect(Bugsnag).to have_sent_notification{ |payload, headers|
event = get_event_from_payload(payload)
expect(event["unhandled"]).to be false
expect(event["severity"]).to eq("info")
expect(event["severityReason"]).to eq({
"type" => "errorClass",
"attributes" => {
"errorClass" => "SignalException"
}
})
}
ensure
Bugsnag.configuration.ignore_classes = original_ignore_classes
end
end

# TODO: nested context
Expand Down Expand Up @@ -1062,7 +1071,7 @@ def gloops
expect(exception["message"]).to eq("'nil' was notified as an exception")
}
end

it "includes bugsnag lines marked out of project" do
notify_test_exception
expect(Bugsnag).to have_sent_notification{ |payload, headers|
Expand Down

0 comments on commit 17a6906

Please sign in to comment.