Skip to content

Commit

Permalink
Added SystemExit & Interrupt to ignore_classes by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Cawllec committed Dec 5, 2017
1 parent bbef3cc commit 5c45a2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/bugsnag/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ def initialize
self.send_environment = false
self.send_code = true
self.meta_data_filters = Set.new(DEFAULT_META_DATA_FILTERS)
self.ignore_classes = Set.new([])
self.endpoint = DEFAULT_ENDPOINT
self.hostname = default_hostname
self.timeout = 15
self.notify_release_stages = nil

# 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])

# Read the API key from the environment
self.api_key = ENV["BUGSNAG_API_KEY"]

Expand Down
4 changes: 4 additions & 0 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
expect(subject.delivery_method).to eq(:wow)
end
end

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

0 comments on commit 5c45a2b

Please sign in to comment.