From da10ba8b0d2cbd67866824472442804ad4b4ffd2 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Mon, 23 Jan 2012 01:09:38 +0100 Subject: Ignore non-existence of {desc,events}.js --- model_fs.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model_fs.js b/model_fs.js index a4d2bef..fb3d015 100644 --- a/model_fs.js +++ b/model_fs.js @@ -36,7 +36,7 @@ exports.rebuildFiles = function() { next(); }).on("file", function(root, fileStats, next) { if(fileStats.name == configuration.description || fileStats.name == configuration.events) { - next(); + next(); } else if(fileStats.name == configuration.template) { var lastDir = root.split('/'); @@ -66,7 +66,7 @@ exports.rebuildFiles = function() { /* collects descriptions and adds them to the slideset */ var collectDescs = function(slideset) { fs.readFile(path.join(__dirname, configuration.dir, slideset, configuration.description), function(err, data) { - if(err) { throw err; } + if(err) { setSlides(slideset, newSlides[slideset], function(err) { if(err) { throw err}}); return; } var descs = JSON.parse(data.toString()); for(var file in newSlides[slideset]['slides']) { if(!newSlides[slideset]['slides'].hasOwnProperty(file)) { continue; } @@ -86,11 +86,11 @@ exports.rebuildFiles = function() { /* collect events and adds them to the slideset */ var collectEvents = function(slideset) { fs.readFile(path.join(__dirname, configuration.dir, slideset, configuration.events), function(err, data) { - if(err) { throw err; } + if(err) { return; } try { var events = JSON.parse(data.toString()); } catch(e) { - throw err; + return; } if(events['type'] == 'text') { setEvents(slideset, events['events'], function(err) { -- cgit v1.2.1