diff --git a/app/filesWatcher.js b/app/filesWatcher.js index 447922b3d38b1afa65dab134a506668a1a3e5919..21fed1464cb99be13a78f0a3ee93f95ad4b7e786 100644 --- a/app/filesWatcher.js +++ b/app/filesWatcher.js @@ -155,7 +155,12 @@ module.exports = function(config, models){ shortPath = "private/" shortPath += partialPath fs.readFile(path, 'utf8', function(err, contents) { - const tut = JSON.parse(contents); + var tut = {} + try { + tut = JSON.parse(contents); + } catch (err) { + logger.warn(`json parse error for file ${path}: ${stringify(err)}`) + } var title, authors, description; try { title = tut["cells"][0]["title"];