소스 검색

no index return 404

visuddhinanda 2 달 전
부모
커밋
150d83f895
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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);
+        }
     }
 
     /**