Skip to content

Commit

Permalink
Merge pull request #190 from datacite/make-middleware-handle-differen…
Browse files Browse the repository at this point in the history
…t-errors

log non-mimetype errors to sentry
  • Loading branch information
wendelfabianchinsamy authored Oct 24, 2024
2 parents 976463a + 8b083ed commit 4811270
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/middleware/compressed_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ def call(env)
begin
status, headers, response = @app.call(env)
[status, headers, response]
rescue => err
rescue ActionDispatch::Http::MimeNegotiation::InvalidType => error
Rails.logger.error(err.inspect)
[406, {}, [{"status": 406, "title": err.message}.to_json]]
rescue => err
Raven.capture_exception(err)
[500, {}, [{"status": 400, "title": err.message}.to_json]]
end
end

Expand Down

0 comments on commit 4811270

Please sign in to comment.