Skip to content

Commit

Permalink
remove bugsnag. datacite/datacite#703
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Mar 20, 2019
1 parent 6601bb6 commit b137c3a
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 30 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ gem 'dalli', '~> 2.7', '>= 2.7.6'
gem 'lograge', '~> 0.10.0'
gem 'logstash-event', '~> 1.2', '>= 1.2.02'
gem 'logstash-logger', '~> 0.26.1'
# gem 'bugsnag', '~> 6.1', '>= 6.1.1'
gem 'sentry-raven', '~> 2.9'
gem 'gender_detector', '~> 0.1.2'
gem 'active_model_serializers', '~> 0.10.0'
Expand Down
12 changes: 0 additions & 12 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class ApplicationController < ActionController::API
# pass ability into serializer
serialization_scope :current_ability

# before_bugsnag_notify :add_user_info_to_bugsnag

before_action :default_format_json, :transform_params, :set_raven_context
after_action :set_jsonp_format, :set_consumer_header

Expand Down Expand Up @@ -124,16 +122,6 @@ def append_info_to_payload(payload)
payload[:uid] = current_user.uid.downcase if current_user.try(:uid)
end

# def add_user_info_to_bugsnag(report)
# return nil unless current_user.try(:uid)

# report.user = {
# email: current_user.email,
# name: current_user.name,
# id: current_user.uid
# }
# end

def set_raven_context
if current_user.try(:uid)
Raven.user_context(
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/clients_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def index
options[:is_collection] = true

render json: ClientSerializer.new(@clients, options).serialized_json, status: :ok
rescue Elasticsearch::Transport::Transport::Errors::GatewayTimeout => exception
head :gateway_timeout
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Raven.capture_exception(exception)

Expand Down
3 changes: 0 additions & 3 deletions app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class DoisController < ApplicationController
prepend_before_action :authenticate_user!
before_action :set_doi, only: [:show, :destroy, :get_url]
before_action :set_include, only: [:index, :show, :create, :update]
# before_bugsnag_notify :add_metadata_to_bugsnag

def index
authorize! :read, Doi
Expand Down Expand Up @@ -156,8 +155,6 @@ def index
end
format.any(:bibtex, :citeproc, :codemeta, :crosscite, :datacite, :datacite_json, :jats, :ris, :csv, :schema_org) { render request.format.to_sym => response.records.to_a }
end
rescue Elasticsearch::Transport::Transport::Errors::GatewayTimeout => exception
head :gateway_timeout
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Raven.capture_exception(exception)

Expand Down
2 changes: 0 additions & 2 deletions app/controllers/members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def index
options[:links] = nil

render json: MemberSerializer.new(@members, options).serialized_json, status: :ok
rescue Elasticsearch::Transport::Transport::Errors::GatewayTimeout => exception
head :gateway_timeout
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Raven.capture_exception(exception)

Expand Down
1 change: 0 additions & 1 deletion app/controllers/works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ class WorksController < ApplicationController
prepend_before_action :authenticate_user!
before_action :set_doi, only: [:show]
before_action :set_include, only: [:index, :show]
# before_bugsnag_notify :add_metadata_to_bugsnag

def index
authorize! :read, Doi
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
config.release = "lupo:" + Lupo::Application::VERSION
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)

# ignore 502 and 503 from Elasticsearch
config.excluded_exceptions += ['Elasticsearch::Transport::Transport::Errors::BadGateway', 'Elasticsearch::Transport::Transport::Errors::ServiceUnavailable']
# ignore 502, 503 and 504 from Elasticsearch
config.excluded_exceptions += ['Elasticsearch::Transport::Transport::Errors::BadGateway', 'Elasticsearch::Transport::Transport::Errors::ServiceUnavailable', 'Elasticsearch::Transport::Transport::Errors::GatewayTimeout']
end
7 changes: 0 additions & 7 deletions vendor/middleman/source/layouts/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@
<link href="<%= ENV['CDN_URL'] %>/stylesheets/datacite.css" rel='stylesheet' type='text/css'>

<link href="<%= ENV['CDN_URL'] %>/images/favicon.ico" rel="icon" type="image/ico" />

<% if ENV['BUGSNAG_JS_KEY'] %>
<script
src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-2.min.js"
data-apikey="<%= ENV['BUGSNAG_JS_KEY'] %>">
</script>
<% end -%>
</head>
<body>
<% header_links = development? ? data.links.development_links : (stage? ? data.links.stage_links : data.links.production_links) %>
Expand Down

0 comments on commit b137c3a

Please sign in to comment.