Parcourir la source

hotfix index : log erreurs

Benoît Hubert il y a 8 ans
Parent
commit
918fa229e3
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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 {