diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index f31c170f34..b8bd2e86e2 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true class ErrorsController < ApplicationController skip_before_action :verify_authenticity_token @@ -10,6 +9,10 @@ def unprocessable_entity render "unprocessable_entity", status: :unprocessable_entity end + def too_many_requests + render "too_many_requests", status: :too_many_requests + end + def internal_server_error render "internal_server_error", status: :internal_server_error end diff --git a/app/views/errors/too_many_requests.html.erb b/app/views/errors/too_many_requests.html.erb new file mode 100644 index 0000000000..019688672c --- /dev/null +++ b/app/views/errors/too_many_requests.html.erb @@ -0,0 +1,19 @@ +<%= content_for :page_title, "Sorry, there’s a problem with the service" %> + +
+
+

Sorry, there’s a problem with the service

+ +

Try again later.

+ +

+ You’re seeing this message as you’ve tried to access this page repeatedly, + please wait a few moments before trying again. +

+ +

+ If you have any questions, please email us at + <%= t('service.email') %>. +

+
+
diff --git a/config/routes.rb b/config/routes.rb index 5ead43fb23..6c1287bb2b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,7 @@ scope via: :all do get "/404", to: "errors#not_found" get "/422", to: "errors#unprocessable_entity" + get "/429", to: "errors#too_many_requests" get "/500", to: "errors#internal_server_error" end