debian-mirror-gitlab/app/controllers/concerns/graceful_timeout_handling.rb

16 lines
371 B
Ruby
Raw Normal View History

2020-10-24 23:57:45 +05:30
# frozen_string_literal: true
module GracefulTimeoutHandling
extend ActiveSupport::Concern
included do
rescue_from ActiveRecord::QueryCanceled do |exception|
raise exception unless request.format.json?
log_exception(exception)
render json: { error: _('There is too much data to calculate. Please change your selection.') }
end
end
end