Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Bugsnag 6.x #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
trouble (0.0.13)
trouble (0.1.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -47,4 +47,4 @@ DEPENDENCIES
trouble!

BUNDLED WITH
1.13.6
1.16.4
9 changes: 6 additions & 3 deletions lib/trouble.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ def self.log(exception, metadata = nil)
# Internal: Dispatch the Exception to the backend(s).
#
def self.notify_error_service(exception, metadata)
Bugsnag.notify(exception, metadata) if defined?(Bugsnag)
return unless defined? Bugsnag
Bugsnag.notify(exception) do |report|
report.metadata = metadata
end
end
# Internal: track exceptions metric

# Internal: track exceptions metric
#
def self.increment_metric
Meter.increment('exceptions') if defined?(Meter)
Expand Down
4 changes: 2 additions & 2 deletions lib/trouble/version.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Trouble
module VERSION #:nodoc:
MAJOR = 0
MINOR = 0
TINY = 13
MINOR = 1
TINY = 0

STRING = [MAJOR, MINOR, TINY].compact.join('.')
end
Expand Down
4 changes: 3 additions & 1 deletion spec/lib/trouble_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
end

it 'uses Bugsnag as notification backend' do
Bugsnag.should_receive(:notify).with(exception, metadata)
report = stub
report.should_receive(:metadata=).with(metadata)
Bugsnag.should_receive(:notify).with(exception).and_yield(report)
trouble.notify exception, metadata
end
end
Expand Down