Replaced hoptoad gem with airbrake gem
This commit is contained in:
parent
0c6d1fa233
commit
7d2afc623d
4 changed files with 27 additions and 34 deletions
2
Gemfile
2
Gemfile
|
|
@ -141,7 +141,7 @@ gem 'axlsx', git: 'https://github.com/randym/axlsx.git'
|
||||||
gem 'axlsx_rails'
|
gem 'axlsx_rails'
|
||||||
|
|
||||||
# as error catcher
|
# as error catcher
|
||||||
gem 'hoptoad_notifier', '~> 2.3'
|
gem 'airbrake', '~> 7.1'
|
||||||
|
|
||||||
# to make links faster
|
# to make links faster
|
||||||
gem 'turbolinks'
|
gem 'turbolinks'
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@ GEM
|
||||||
safely_block (>= 0.1.1)
|
safely_block (>= 0.1.1)
|
||||||
user_agent_parser
|
user_agent_parser
|
||||||
uuidtools
|
uuidtools
|
||||||
|
airbrake (7.1.1)
|
||||||
|
airbrake-ruby (~> 2.5)
|
||||||
|
airbrake-ruby (2.7.0)
|
||||||
arel (7.1.4)
|
arel (7.1.4)
|
||||||
ast (2.3.0)
|
ast (2.3.0)
|
||||||
autoprefixer-rails (7.1.1)
|
autoprefixer-rails (7.1.1)
|
||||||
|
|
@ -221,9 +224,6 @@ GEM
|
||||||
sysexits (~> 1.1)
|
sysexits (~> 1.1)
|
||||||
hashdiff (0.3.4)
|
hashdiff (0.3.4)
|
||||||
hashie (3.5.5)
|
hashie (3.5.5)
|
||||||
hoptoad_notifier (2.4.11)
|
|
||||||
activesupport
|
|
||||||
builder
|
|
||||||
htmlentities (4.3.4)
|
htmlentities (4.3.4)
|
||||||
http-cookie (1.0.2)
|
http-cookie (1.0.2)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
|
|
@ -577,6 +577,7 @@ DEPENDENCIES
|
||||||
acts_as_commentable_with_threading
|
acts_as_commentable_with_threading
|
||||||
acts_as_list
|
acts_as_list
|
||||||
ahoy_matey
|
ahoy_matey
|
||||||
|
airbrake (~> 7.1)
|
||||||
autoprefixer-rails
|
autoprefixer-rails
|
||||||
awesome_nested_set (~> 3.1.3)
|
awesome_nested_set (~> 3.1.3)
|
||||||
axlsx!
|
axlsx!
|
||||||
|
|
@ -613,7 +614,6 @@ DEPENDENCIES
|
||||||
guard-rspec
|
guard-rspec
|
||||||
haml-rails
|
haml-rails
|
||||||
haml_lint (~> 0.24.0)
|
haml_lint (~> 0.24.0)
|
||||||
hoptoad_notifier (~> 2.3)
|
|
||||||
iso-639
|
iso-639
|
||||||
jquery-datatables-rails (~> 2.2.1)
|
jquery-datatables-rails (~> 2.2.1)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
|
|
|
||||||
22
config/initializers/airbrake.rb
Normal file
22
config/initializers/airbrake.rb
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
Airbrake.configure do |config|
|
||||||
|
# Change this to some sensible data for your errbit instance
|
||||||
|
config.project_id = ENV['OSEM_ERRBIT_APIKEY'] || Rails.application.secrets.errbit_key || ''
|
||||||
|
config.project_key = ENV['OSEM_ERRBIT_APIKEY'] || Rails.application.secrets.errbit_key || ''
|
||||||
|
config.host = ENV['OSEM_ERRBIT_HOST']
|
||||||
|
config.environment = Rails.env
|
||||||
|
if config.project_key.blank? || config.host.blank?
|
||||||
|
config.ignore_environments = [:production, :development, :test]
|
||||||
|
else
|
||||||
|
config.ignore_environments = [:development, :test]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Airbrake.add_filter do |notice|
|
||||||
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActiveRecord::RecordNotFound' }
|
||||||
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::InvalidAuthenticityToken' }
|
||||||
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::UnknownAction' }
|
||||||
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'AbstractController::ActionNotFound' }
|
||||||
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionView::MissingTemplate' }
|
||||||
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::UnknownFormat' }
|
||||||
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::RoutingError' && error[:message] =~ %r{\[GET\]} }
|
||||||
|
end
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
HoptoadNotifier.configure do |config|
|
|
||||||
# Change this to some sensible data for your errbit instance
|
|
||||||
config.api_key = ENV['OSEM_ERRBIT_APIKEY'] || Rails.application.secrets.errbit_key || ''
|
|
||||||
config.host = ENV['OSEM_ERRBIT_HOST']
|
|
||||||
if config.api_key.blank? || config.host.blank?
|
|
||||||
config.development_environments = 'production development test'
|
|
||||||
else
|
|
||||||
config.development_environments = 'development test'
|
|
||||||
end
|
|
||||||
|
|
||||||
config.ignore_only = %w{
|
|
||||||
ActiveRecord::RecordNotFound
|
|
||||||
ActionController::InvalidAuthenticityToken
|
|
||||||
ActionController::UnknownAction
|
|
||||||
AbstractController::ActionNotFound
|
|
||||||
ActionView::MissingTemplate
|
|
||||||
ActionController::UnknownFormat
|
|
||||||
}
|
|
||||||
|
|
||||||
config.ignore_by_filter do |exception_data|
|
|
||||||
ret=false
|
|
||||||
if exception_data[:error_class] == 'ActionController::RoutingError'
|
|
||||||
message = exception_data[:error_message]
|
|
||||||
ret=true if message =~ %r{\[GET\]}
|
|
||||||
end
|
|
||||||
ret
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue