about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-08 23:00:03 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-04-08 23:00:03 +0200
commiteff62528debf33591c921b28ae2609c948161860 (patch)
tree76da7fad9be426213cafdc7f43cba5f00a047caa /app/controllers
parentc483101b4ae7d9f22ea43921c512f479e16e98ca (diff)
parented5491e5de6ede501715c421ad5fa53493f61250 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/v2/search_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/api/v2/search_controller.rb b/app/controllers/api/v2/search_controller.rb
index ddcf92200..77eeab5b0 100644
--- a/app/controllers/api/v2/search_controller.rb
+++ b/app/controllers/api/v2/search_controller.rb
@@ -11,6 +11,10 @@ class Api::V2::SearchController < Api::BaseController
   def index
     @search = Search.new(search_results)
     render json: @search, serializer: REST::SearchSerializer
+  rescue Mastodon::SyntaxError
+    unprocessable_entity
+  rescue ActiveRecord::RecordNotFound
+    not_found
   end
 
   private