debian-mirror-gitlab/app/controllers/concerns/graceful_timeout_handling.rb
2020-10-24 23:57:45 +05:30

15 lines
371 B
Ruby

# 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