gitlab-org--gitlab-foss/app/controllers/concerns/graceful_timeout_handling.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
371 B
Ruby
Raw Normal View History

# 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