Skip to content

Commit

Permalink
Use 504 gateway timeout for rack-timeout errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Redande committed Oct 8, 2024
1 parent e2e8737 commit ef2e7b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class ApplicationController < ActionController::Base
end

rescue_from Rack::Timeout::RequestTimeoutException do |exception|
respond_with_error('Request timed out', 503, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error
respond_with_error('Request timed out', 504, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error
end

rescue_from Rack::Timeout::RequestTimeoutError do |exception|
respond_with_error('Request timed out', 503, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error
respond_with_error('Request timed out', 504, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error
end

before_action :set_default_url_options
Expand Down

0 comments on commit ef2e7b7

Please sign in to comment.