Yuki Takei пре 6 година
родитељ
комит
898ba4a258
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      src/server/routes/admin.js

+ 6 - 1
src/server/routes/admin.js

@@ -1152,7 +1152,12 @@ module.exports = function(crowi, app) {
       return res.json(ApiResponse.error('ElasticSearch Integration is not set up.'));
     }
 
-    await search.buildIndex();
+    try {
+      await search.buildIndex();
+    }
+    catch (err) {
+      return res.json(ApiResponse.error(err));
+    }
 
     return res.json(ApiResponse.success());
   };