diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index 134174898..ea280bd9d 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -50,8 +50,7 @@ def index render json: ActivitySerializer.new(@activities, options).serialized_json, status: :ok rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception - # Bugsnag.notify(exception) - Raven.capture_exception(error) + Raven.capture_exception(exception) message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason") diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb index 40f7733ac..919c6fc85 100644 --- a/app/controllers/clients_controller.rb +++ b/app/controllers/clients_controller.rb @@ -62,8 +62,7 @@ def index render json: ClientSerializer.new(@clients, options).serialized_json, status: :ok rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception - # Bugsnag.notify(exception) - Raven.capture_exception(error) + Raven.capture_exception(exception) message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason") diff --git a/app/controllers/data_centers_controller.rb b/app/controllers/data_centers_controller.rb index 4ee2a4d05..55e4ca548 100644 --- a/app/controllers/data_centers_controller.rb +++ b/app/controllers/data_centers_controller.rb @@ -56,8 +56,7 @@ def index render json: DataCenterSerializer.new(@clients, options).serialized_json, status: :ok rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception - # Bugsnag.notify(exception) - Raven.capture_exception(error) + Raven.capture_exception(exception) message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason") diff --git a/app/controllers/providers_controller.rb b/app/controllers/providers_controller.rb index d5c7002db..c34cdea54 100644 --- a/app/controllers/providers_controller.rb +++ b/app/controllers/providers_controller.rb @@ -64,8 +64,7 @@ def index render json: ProviderSerializer.new(@providers, options).serialized_json, status: :ok rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception - # Bugsnag.notify(exception) - Raven.capture_exception(error) + Raven.capture_exception(exception) message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason") diff --git a/app/models/concerns/crosscitable.rb b/app/models/concerns/crosscitable.rb index 7f8313ad5..724dcf565 100644 --- a/app/models/concerns/crosscitable.rb +++ b/app/models/concerns/crosscitable.rb @@ -40,9 +40,8 @@ def parse_xml(input, options={}) meta = from.present? ? send("read_" + from, { string: input, doi: options[:doi], sandbox: sandbox }).compact : {} meta.merge("string" => input, "from" => from) rescue NoMethodError, ArgumentError => exception - # Bugsnag.notify(exception) - Raven.capture_exception(error) - + Raven.capture_exception(exception) + logger = Logger.new(STDOUT) logger.error "Error " + exception.message + " for doi " + @doi + "." logger.error exception diff --git a/app/models/doi.rb b/app/models/doi.rb index 3d8a764d2..5bea93851 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -389,7 +389,6 @@ def self.import_one(doi_id: nil) doi rescue TypeError, NoMethodError, RuntimeError, ActiveRecord::StatementInvalid, ActiveRecord::LockWaitTimeout => error logger.error "[MySQL] Error importing metadata for " + doi.doi + ": " + error.message - # Bugsnag.notify(error) Raven.capture_exception(error) doi end @@ -462,7 +461,6 @@ def self.import_by_day(options={}) doi.__elasticsearch__.index_document rescue TypeError, NoMethodError, RuntimeError, ActiveRecord::StatementInvalid, ActiveRecord::LockWaitTimeout => error logger.error "[MySQL] Error importing metadata for " + doi.doi + ": " + error.message - # Bugsnag.notify(error) Raven.capture_exception(error) else count += 1 @@ -520,7 +518,6 @@ def self.import_by_day_missing(options={}) doi.__elasticsearch__.index_document rescue TypeError, NoMethodError, RuntimeError, ActiveRecord::StatementInvalid, ActiveRecord::LockWaitTimeout => error logger.error "[MySQL] Error importing metadata for " + doi.doi + ": " + error.message - # Bugsnag.notify(error) Raven.capture_exception(error) else count += 1