Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/search.rb')
-rw-r--r--lib/api/search.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/search.rb b/lib/api/search.rb
index 3c5801366a8..fbdbe3476db 100644
--- a/lib/api/search.rb
+++ b/lib/api/search.rb
@@ -8,6 +8,10 @@ module API
feature_category :global_search
+ rescue_from ActiveRecord::QueryCanceled do |e|
+ render_api_error!({ error: 'Request timed out' }, 408)
+ end
+
helpers do
SCOPE_ENTITY = {
merge_requests: Entities::MergeRequestBasic,