Skip to content

remove airbrake, add bugsnag #304

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

Merged
merged 1 commit into from
Jan 23, 2015
Merged
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ group :test do
gem 'stripe-ruby-mock', git: 'https://github.com/rebelidealist/stripe-ruby-mock', branch: 'live-tests'
end

gem 'airbrake'
gem 'bugsnag'
group :production do
gem 'newrelic_rpm'
gem 'puma'
Expand Down
7 changes: 3 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ GEM
acts_as_commentable (2.0.1)
acts_as_follower (0.1.1)
addressable (2.3.6)
airbrake (4.1.0)
builder
multi_json
annotate (2.6.5)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
Expand Down Expand Up @@ -120,6 +117,8 @@ GEM
debug_inspector (>= 0.0.1)
blankslate (3.1.3)
buftok (0.2.0)
bugsnag (2.7.1)
multi_json (~> 1.0)
builder (3.0.4)
byebug (2.7.0)
columnize (~> 0.3)
Expand Down Expand Up @@ -737,13 +736,13 @@ DEPENDENCIES
acts-as-taggable-on (~> 3.4)
acts_as_commentable (= 2.0.1)
acts_as_follower (= 0.1.1)
airbrake
annotate
autoprefixer-rails
awesome_print
backbone-on-rails
better_errors
binding_of_caller
bugsnag
capybara
capybara-screenshot
carrierwave
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class AccountsController < ApplicationController
before_action :ensure_account_admin, except: [:create]
before_action :determine_plan, only: [:create, :update]
before_action :ensure_eligibility, only: [:new]
before_action :paying_user_context, if: ->() { Rails.env.production? }

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

def paying_user_context
# Honeybadger.context(user_email: current_user.try(:email)) if current_user
end

def account_params
params.require(:teams_account).permit(:stripe_card_token)
end
Expand Down
3 changes: 0 additions & 3 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,15 @@ def create
end
rescue Faraday::Error::ConnectionFailed => ex
Rails.logger.error("Faraday::Error::ConnectionFailed => #{ex.message}, #{ex.inspect}")
# notify_honeybadger(ex) if Rails.env.production?
record_event("error", message: "attempt to reuse a linked account")
flash[:error] = "Error linking #{oauth[:info][:nickname]} because it is already associated with a different member."
redirect_to(root_url)
rescue ActiveRecord::RecordNotUnique => ex
# notify_honeybadger(ex) if Rails.env.production?
record_event("error", message: "attempt to reuse a linked account")
flash[:error] = "Error linking #{oauth[:info] && oauth[:info][:nickname]} because it is already associated with a different member."
redirect_to(root_url)
rescue Exception => ex
Rails.logger.error("Failed to link account because #{ex.message} => '#{oauth}'")
# notify_honeybadger(ex) if Rails.env.production?
record_event("error", message: "signup failure")
flash[:notice] = "Looks like something went wrong. Please try again."
redirect_to(root_url)
Expand Down
2 changes: 0 additions & 2 deletions app/models/teams/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ def save_with_payment(plan=nil)
return false
end
rescue Stripe::CardError => e
# Honeybadger.notify(e) if Rails.env.production?
Rails.logger.error "Stripe error while creating customer: #{e.message}" if ENV['DEBUG']
errors.add :base, e.message
return false
rescue Stripe::InvalidRequestError => e
# Honeybadger.notify(e) if Rails.env.production?
Rails.logger.error "Stripe error while creating customer: #{e.message}" if ENV['DEBUG']
errors.add :base, "There was a problem with your credit card."
# throw e if Rails.env.development?
Expand Down
9 changes: 0 additions & 9 deletions config/initializers/airbrake.rb

This file was deleted.

9 changes: 9 additions & 0 deletions config/initializers/bugsnag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if defined?(Bugsnag)
Bugsnag.configure do |config|
config.api_key = ENV['BUGSNAG_API_KEY']
end
else
unless Rails.env.test? || Rails.env.development?
Rails.logger.warn '[WTF WARNING] Someone deleted bugsnag and forgot the initializer'
end
end
13 changes: 0 additions & 13 deletions spec/lib/omniauth_spec.rb

This file was deleted.