diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index 6b5abfc42..6b4c63f65 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -22,4 +22,11 @@ class ErrorsController < ApplicationController format.json { render json: { error: "Unprocessable entity" }, status: :unprocessable_entity } end end + + def too_many_requests + respond_to do |format| + format.html { render status: :too_many_requests } + format.json { render json: { error: "Too many requests" }, status: :too_many_requests } + end + end end diff --git a/app/views/errors/too_many_requests.erb b/app/views/errors/too_many_requests.erb new file mode 100644 index 000000000..2e41652e7 --- /dev/null +++ b/app/views/errors/too_many_requests.erb @@ -0,0 +1,8 @@ +<% content_for :title, "Sorry, you have sent too many requests to our service" %> + +
Try again in a minute.
+