diff --git a/lib/middleware/compressed_requests.rb b/lib/middleware/compressed_requests.rb index ca7135e..f9aef63 100644 --- a/lib/middleware/compressed_requests.rb +++ b/lib/middleware/compressed_requests.rb @@ -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