Remove airbrake

This commit is contained in:
Eric Schultz 2019-03-01 13:13:42 -06:00
parent 7bc82350bd
commit f968fb96d9
9 changed files with 0 additions and 118 deletions

View file

@ -76,9 +76,6 @@ gem 'httparty'
gem 'devise' gem 'devise'
gem 'devise-async' gem 'devise-async'
# https://github.com/airbrake/airbrake
gem 'airbrake', '~> 6.2.1'
# http://www.rubygeocoder.com/ # http://www.rubygeocoder.com/
gem 'geocoder' # for adding latitude and longitude to location-based tables gem 'geocoder' # for adding latitude and longitude to location-based tables

View file

@ -70,9 +70,6 @@ GEM
i18n (~> 0.6, >= 0.6.4) i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0) multi_json (~> 1.0)
addressable (2.3.8) addressable (2.3.8)
airbrake (6.2.1)
airbrake-ruby (~> 2.3, >= 2.3.1)
airbrake-ruby (2.3.2)
amq-protocol (2.2.0) amq-protocol (2.2.0)
andand (1.3.3) andand (1.3.3)
arel (3.0.3) arel (3.0.3)
@ -427,7 +424,6 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
action_mailer_matchers action_mailer_matchers
airbrake (~> 6.2.1)
aws-sdk aws-sdk
aws-ses aws-ses
binding_of_caller binding_of_caller

View file

@ -1,87 +0,0 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
require 'airbrake/delayed_job'
# Airbrake is an online tool that provides robust exception tracking in your Rails
# applications. In doing so, it allows you to easily review errors, tie an error
# to an individual piece of code, and trace the cause back to recent
# changes. Airbrake enables for easy categorization, searching, and prioritization
# of exceptions so that when errors occur, your team can quickly determine the
# root cause.
#
# Configuration details:
# https://github.com/airbrake/airbrake-ruby#configuration
if ENV['AIRBRAKE_PROJECT_ID'] && ENV['AIRBRAKE_API_KEY']
Airbrake.configure do |c|
# You must set both project_id & project_key. To find your project_id and
# project_key navigate to your project's General Settings and copy the values
# from the right sidebar.
# https://github.com/airbrake/airbrake-ruby#project_id--project_key
c.project_id = ENV['AIRBRAKE_PROJECT_ID'] || 1
c.project_key = ENV['AIRBRAKE_API_KEY'] || 1
# Configures the root directory of your project. Expects a String or a
# Pathname, which represents the path to your project. Providing this option
# helps us to filter out repetitive data from backtrace frames and link to
# GitHub files from our dashboard.
# https://github.com/airbrake/airbrake-ruby#root_directory
c.root_directory = Rails.root
# By default, Airbrake Ruby outputs to STDOUT. In Rails apps it makes sense to
# use the Rails' logger.
# https://github.com/airbrake/airbrake-ruby#logger
c.logger = Rails.logger
# Configures the environment the application is running in. Helps the Airbrake
# dashboard to distinguish between exceptions occurring in different
# environments.
# NOTE: This option must be set in order to make the 'ignore_environments'
# option work.
# https://github.com/airbrake/airbrake-ruby#environment
c.environment = Rails.env
# Setting this option allows Airbrake to filter exceptions occurring in
# unwanted environments such as :test.
# NOTE: This option *does not* work if you don't set the 'environment' option.
# https://github.com/airbrake/airbrake-ruby#ignore_environments
c.ignore_environments = %w(test)
# A list of parameters that should be filtered out of what is sent to
# Airbrake. By default, all "password" attributes will have their contents
# replaced.
# https://github.com/airbrake/airbrake-ruby#blacklist_keys
c.blacklist_keys = [/password/i, /authorization/i]
# Alternatively, you can integrate with Rails' filter_parameters.
# Read more: https://goo.gl/gqQ1xS
# c.blacklist_keys = Rails.application.config.filter_parameters
end
# A filter that collects request body information. Enable it if you are sure you
# don't send sensitive information to Airbrake in your body (such as passwords).
# https://github.com/airbrake/airbrake#requestbodyfilter
# Airbrake.add_filter(Airbrake::Rack::RequestBodyFilter.new)
# config.ignore << "ArgumentError: invalid byte sequence in UTF-8"
# config.ignore << "SIGTERM"
# end
ignore_exceptions = [ActionDispatch::RemoteIp::IpSpoofAttackError, Encoding::CompatibilityError,
EOFError, AWS::SES::ResponseError, [SignalException, lambda {|e| e.signo == Signal.list['TERM']}]]
Airbrake.add_filter do |notice|
ignore_exceptions.each do |type|
if type.class == Array
notice.ignore! if notice.stash[:exception].is_a?(type[0]) && type[1].call(notice.stash[:exception])
else
notice.ignore! if notice.stash[:exception].is_a?(type)
end
end
end
end
# If you want to convert your log messages to Airbrake errors, we offer an
# integration with the Logger class from stdlib.
# https://github.com/airbrake/airbrake#logger
# Rails.logger = Airbrake::AirbrakeLogger.new(Rails.logger)

View file

@ -1,2 +0,0 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
#ERROR_HANDLER = ENV['ERROR_HANDLER_CLASS'] ? ENV['ERROR_HANDLER_CLASS'].constantize : ErrorHandler::NullErrorHandler

View file

@ -1,8 +0,0 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
module ErrorHandler
class AirbrakeErrorHandler
def notify(*params)
Airbrake.notify(*params)
end
end
end

View file

@ -1,6 +0,0 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
module ErrorHandler
class NullErrorHandler
def notify; end
end
end

View file

@ -111,10 +111,8 @@ module InsertCard
rescue ActiveRecord::ActiveRecordError => e rescue ActiveRecord::ActiveRecordError => e
return {json: {error: "Oops! There was an error saving your card, and it did not complete. Please try again in a moment. Error: #{e}"}, status: :unprocessable_entity} return {json: {error: "Oops! There was an error saving your card, and it did not complete. Please try again in a moment. Error: #{e}"}, status: :unprocessable_entity}
rescue e rescue e
Airbrake.notify(e)
return {json: {error: "Oops! There was an error saving your card, and it did not complete. Please try again in a moment. Error: #{e}"}, status: :unprocessable_entity} return {json: {error: "Oops! There was an error saving your card, and it did not complete. Please try again in a moment. Error: #{e}"}, status: :unprocessable_entity}
rescue e rescue e
Airbrake.notify(e)
return {json: {error: "Oops! There was an error saving your card, and it did not complete. Please try again in a moment. Error: #{e}"}, status: :unprocessable_entity} return {json: {error: "Oops! There was an error saving your card, and it did not complete. Please try again in a moment. Error: #{e}"}, status: :unprocessable_entity}
end end

View file

@ -65,7 +65,6 @@ module InsertCharge
unless card.holder == supporter unless card.holder == supporter
if (data[:old_donation]) if (data[:old_donation])
#these are not new donations so we let them fly (for now) #these are not new donations so we let them fly (for now)
Airbrake.notify(ParamValidation::ValidationError.new("#{data[:card_id]} does not belong to this supporter #{supporter.id} as warning", {:key => :card_id}))
else else
raise ParamValidation::ValidationError.new("#{data[:card_id]} does not belong to this supporter #{supporter.id}", {:key => :card_id}) raise ParamValidation::ValidationError.new("#{data[:card_id]} does not belong to this supporter #{supporter.id}", {:key => :card_id})
end end
@ -77,7 +76,6 @@ module InsertCharge
stripe_customer_id = card.stripe_customer_id stripe_customer_id = card.stripe_customer_id
stripe_account_id = StripeAccount.find_or_create(data[:nonprofit_id]) stripe_account_id = StripeAccount.find_or_create(data[:nonprofit_id])
rescue => e rescue => e
Airbrake.notify(e, other_data: data)
raise e raise e
end end
nonprofit_currency = Qx.select(:currency).from(:nonprofits).where("id=$id", id: data[:nonprofit_id]).execute.first['currency'] nonprofit_currency = Qx.select(:currency).from(:nonprofits).where("id=$id", id: data[:nonprofit_id]).execute.first['currency']
@ -117,10 +115,8 @@ module InsertCharge
stripe_charge = Stripe::Charge.create(*params) stripe_charge = Stripe::Charge.create(*params)
rescue Stripe::CardError => e rescue Stripe::CardError => e
failure_message = "There was an error with your card: #{e.json_body[:error][:message]}" failure_message = "There was an error with your card: #{e.json_body[:error][:message]}"
Airbrake.notify(e)
rescue Stripe::StripeError => e rescue Stripe::StripeError => e
failure_message = "We're sorry, but something went wrong. We've been notified about this issue." failure_message = "We're sorry, but something went wrong. We've been notified about this issue."
Airbrake.notify(e)
end end
@ -163,7 +159,6 @@ module InsertCharge
return result return result
rescue => e rescue => e
Airbrake.notify(e)
raise e raise e
end end
end end

View file

@ -14,7 +14,6 @@ module JobTypes
end end
def error(job, exception) def error(job, exception)
Airbrake.notify(exception)
end end
def reschedule_at(current_time, attempts) def reschedule_at(current_time, attempts)