Commit 15145fc8 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'osw-gracefully-handle-puma-timeouts-in-api' into 'master'

Log Puma timeouts for API calls

See merge request gitlab-org/gitlab!30885
parents 2b5c2980 b7a0bee7
...@@ -97,6 +97,15 @@ module API ...@@ -97,6 +97,15 @@ module API
handle_api_exception(exception) handle_api_exception(exception)
end end
# This is a specific exception raised by `rack-timeout` gem when Puma
# requests surpass its timeout. Given it inherits from Exception, we
# should rescue it separately. For more info, see:
# - https://github.com/sharpstone/rack-timeout/blob/master/doc/exceptions.md
# - https://github.com/ruby-grape/grape#exception-handling
rescue_from Rack::Timeout::RequestTimeoutException do |exception|
handle_api_exception(exception)
end
format :json format :json
content_type :txt, "text/plain" content_type :txt, "text/plain"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment