Explorar o código

hotfix index : log erreurs

Benoît Hubert %!s(int64=8) %!d(string=hai) anos
pai
achega
918fa229e3
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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 {