Browse Source

no index return 404

visuddhinanda 2 days ago
parent
commit
150d83f895
1 changed files with 5 additions and 1 deletions
  1. 5 1
      api-v13/app/Http/Controllers/SearchPlusController.php

+ 5 - 1
api-v13/app/Http/Controllers/SearchPlusController.php

@@ -129,7 +129,11 @@ class SearchPlusController extends Controller
     public function show($id)
     {
         //
-        return $this->ok(HitItemDTO::fromArray($this->searchService->get($id)));
+        try {
+            return $this->ok(HitItemDTO::fromArray($this->searchService->get($id)));
+        } catch (\Throwable $th) {
+            return $this->error("no such index {$id}", 404, 404);
+        }
     }
 
     /**