فهرست منبع

add error handling

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());
   };