Skip to content

Commit

Permalink
don't report to sentry when elasticsearch 400 error
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 12, 2019
1 parent 9a492c3 commit d9e0017
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ def index
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::BadRequest => exception
Raven.capture_exception(exception)

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

render json: { "errors" => { "title" => message }}.to_json, status: :bad_request
Expand Down

0 comments on commit d9e0017

Please sign in to comment.