Skip to content

Commit

Permalink
remove custom bugsnag calls. #214
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Mar 12, 2019
1 parent 7302710 commit 81e719d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def index

render json: ActivitySerializer.new(@activities, options).serialized_json, status: :ok
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Bugsnag.notify(exception)
# Bugsnag.notify(exception)
Raven.capture_exception(error)

message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason")

Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def authenticated_user
message = exception.message
else
# Bugsnag.notify(exception)
Raven.capture_exception(error)

message = exception.message
end
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/clients_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def index

render json: ClientSerializer.new(@clients, options).serialized_json, status: :ok
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Bugsnag.notify(exception)
# Bugsnag.notify(exception)
Raven.capture_exception(error)

message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason")

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/data_centers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def index

render json: DataCenterSerializer.new(@clients, options).serialized_json, status: :ok
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Bugsnag.notify(exception)
# Bugsnag.notify(exception)
Raven.capture_exception(error)

message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason")

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def index

render json: MemberSerializer.new(@members, options).serialized_json, status: :ok
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Bugsnag.notify(exception)
# Bugsnag.notify(exception)

message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason")

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def index

render json: ProviderSerializer.new(@providers, options).serialized_json, status: :ok
rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception
Bugsnag.notify(exception)
# Bugsnag.notify(exception)
Raven.capture_exception(error)

message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason")

Expand Down
4 changes: 3 additions & 1 deletion app/models/concerns/crosscitable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ 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)
# Bugsnag.notify(exception)
Raven.capture_exception(error)

logger = Logger.new(STDOUT)
logger.error "Error " + exception.message + " for doi " + @doi + "."
logger.error exception
Expand Down
9 changes: 6 additions & 3 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ 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)
# Bugsnag.notify(error)
Raven.capture_exception(error)
doi
end

Expand Down Expand Up @@ -458,7 +459,8 @@ 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)
# Bugsnag.notify(error)
Raven.capture_exception(error)
else
count += 1
end
Expand Down Expand Up @@ -515,7 +517,8 @@ 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)
# Bugsnag.notify(error)
Raven.capture_exception(error)
else
count += 1
end
Expand Down

0 comments on commit 81e719d

Please sign in to comment.