From 89ac6916b6e63a6d2fb2122195e8789de6aeaac6 Mon Sep 17 00:00:00 2001 From: Jussi Laasonen Date: Mon, 11 Mar 2019 13:50:45 +0100 Subject: [PATCH] Catch errors --- lib/countAndSaveHits.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/countAndSaveHits.js b/lib/countAndSaveHits.js index 37c6ab3..449a826 100644 --- a/lib/countAndSaveHits.js +++ b/lib/countAndSaveHits.js @@ -4,5 +4,6 @@ const saveHits = require('./saveHits') module.exports = async function countAndSaveHits (directory, uri, db) { const hits = extractFromDir(directory) await saveHits(hits, uri, db) - console.log('Done!') + .then(() => console.log('Done!')) + .catch(console.error) }