Skip to content

Commit 11ad458

Browse files
committed
Merge pull request #304 from avinoth/master
remove airbrake, add bugsnag
2 parents 2586b00 + 2b3506a commit 11ad458

File tree

8 files changed

+13
-38
lines changed

8 files changed

+13
-38
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ group :test do
184184
gem 'stripe-ruby-mock', git: 'https://github.com/rebelidealist/stripe-ruby-mock', branch: 'live-tests'
185185
end
186186

187-
gem 'airbrake'
187+
gem 'bugsnag'
188188
group :production do
189189
gem 'newrelic_rpm'
190190
gem 'puma'

Gemfile.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ GEM
8686
acts_as_commentable (2.0.1)
8787
acts_as_follower (0.1.1)
8888
addressable (2.3.6)
89-
airbrake (4.1.0)
90-
builder
91-
multi_json
9289
annotate (2.6.5)
9390
activerecord (>= 2.3.0)
9491
rake (>= 0.8.7)
@@ -120,6 +117,8 @@ GEM
120117
debug_inspector (>= 0.0.1)
121118
blankslate (3.1.3)
122119
buftok (0.2.0)
120+
bugsnag (2.7.1)
121+
multi_json (~> 1.0)
123122
builder (3.0.4)
124123
byebug (2.7.0)
125124
columnize (~> 0.3)
@@ -737,13 +736,13 @@ DEPENDENCIES
737736
acts-as-taggable-on (~> 3.4)
738737
acts_as_commentable (= 2.0.1)
739738
acts_as_follower (= 0.1.1)
740-
airbrake
741739
annotate
742740
autoprefixer-rails
743741
awesome_print
744742
backbone-on-rails
745743
better_errors
746744
binding_of_caller
745+
bugsnag
747746
capybara
748747
capybara-screenshot
749748
carrierwave

app/controllers/accounts_controller.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ class AccountsController < ApplicationController
55
before_action :ensure_account_admin, except: [:create]
66
before_action :determine_plan, only: [:create, :update]
77
before_action :ensure_eligibility, only: [:new]
8-
before_action :paying_user_context, if: ->() { Rails.env.production? }
98

109
def new
1110
@account ||= current_user.team.build_account
@@ -31,7 +30,6 @@ def create
3130
redirect_to new_team_opportunity_path(@team), notice: "You are subscribed to #{@plan.name}." + plan_capability(@plan, @team)
3231
else
3332
Rails.logger.error "Error creating account #{@account.errors.inspect}"
34-
# Honeybadger.notify(error_class: 'Payments', error_message: @account.errors.full_messages.join("\n"), parameters: params) if Rails.env.production?
3533
flash[:error] = @account.errors.full_messages.join("\n")
3634
redirect_to employers_path
3735
end
@@ -103,10 +101,6 @@ def plan_capability(plan, team)
103101
message
104102
end
105103

106-
def paying_user_context
107-
# Honeybadger.context(user_email: current_user.try(:email)) if current_user
108-
end
109-
110104
def account_params
111105
params.require(:teams_account).permit(:stripe_card_token)
112106
end

app/controllers/sessions_controller.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,15 @@ def create
4242
end
4343
rescue Faraday::Error::ConnectionFailed => ex
4444
Rails.logger.error("Faraday::Error::ConnectionFailed => #{ex.message}, #{ex.inspect}")
45-
# notify_honeybadger(ex) if Rails.env.production?
4645
record_event("error", message: "attempt to reuse a linked account")
4746
flash[:error] = "Error linking #{oauth[:info][:nickname]} because it is already associated with a different member."
4847
redirect_to(root_url)
4948
rescue ActiveRecord::RecordNotUnique => ex
50-
# notify_honeybadger(ex) if Rails.env.production?
5149
record_event("error", message: "attempt to reuse a linked account")
5250
flash[:error] = "Error linking #{oauth[:info] && oauth[:info][:nickname]} because it is already associated with a different member."
5351
redirect_to(root_url)
5452
rescue Exception => ex
5553
Rails.logger.error("Failed to link account because #{ex.message} => '#{oauth}'")
56-
# notify_honeybadger(ex) if Rails.env.production?
5754
record_event("error", message: "signup failure")
5855
flash[:notice] = "Looks like something went wrong. Please try again."
5956
redirect_to(root_url)

app/models/teams/account.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ def save_with_payment(plan=nil)
4545
return false
4646
end
4747
rescue Stripe::CardError => e
48-
# Honeybadger.notify(e) if Rails.env.production?
4948
Rails.logger.error "Stripe error while creating customer: #{e.message}" if ENV['DEBUG']
5049
errors.add :base, e.message
5150
return false
5251
rescue Stripe::InvalidRequestError => e
53-
# Honeybadger.notify(e) if Rails.env.production?
5452
Rails.logger.error "Stripe error while creating customer: #{e.message}" if ENV['DEBUG']
5553
errors.add :base, "There was a problem with your credit card."
5654
# throw e if Rails.env.development?

config/initializers/airbrake.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

config/initializers/bugsnag.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if defined?(Bugsnag)
2+
Bugsnag.configure do |config|
3+
config.api_key = ENV['BUGSNAG_API_KEY']
4+
end
5+
else
6+
unless Rails.env.test? || Rails.env.development?
7+
Rails.logger.warn '[WTF WARNING] Someone deleted bugsnag and forgot the initializer'
8+
end
9+
end

spec/lib/omniauth_spec.rb

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)