about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-08 23:07:00 +0200
committerGitHub <noreply@github.com>2022-04-08 23:07:00 +0200
commit9309c53d21df806d57dd59dbc59a807d2f8b8b11 (patch)
tree76da7fad9be426213cafdc7f43cba5f00a047caa /app/controllers/api
parentc483101b4ae7d9f22ea43921c512f479e16e98ca (diff)
parenteff62528debf33591c921b28ae2609c948161860 (diff)
Merge pull request #1738 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/api')
-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