浏览代码

hotfix index : log erreurs

Benoît Hubert 8 年之前
父节点
当前提交
918fa229e3
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      lib/indexHandlers.js

+ 5 - 1
lib/indexHandlers.js

@@ -100,7 +100,11 @@ module.exports = function(exStore, exDir, testMode) {
     .then(data => ({
       html: Mustache.render(indexTpml, data),
       code: statusCode ? statusCode : 200
-    }));
+    }))
+    .catch(err => {
+      console.error(err);
+      res.status(500).json({ error: err.message });
+    });
   }
 
   return {