mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Generous badge
This commit is contained in:
@ -75,9 +75,13 @@ class ApplicationController < ActionController::Base
|
||||
render 'default/empty'
|
||||
end
|
||||
|
||||
def render_rate_limit_error(e)
|
||||
render_json_error e.description, type: :rate_limit, status: 429
|
||||
end
|
||||
|
||||
# If they hit the rate limiter
|
||||
rescue_from RateLimiter::LimitExceeded do |e|
|
||||
render_json_error e.description, type: :rate_limit, status: 429
|
||||
render_rate_limit_error(e)
|
||||
end
|
||||
|
||||
rescue_from PG::ReadOnlySqlTransaction do |e|
|
||||
|
Reference in New Issue
Block a user