diff --git a/lib/executor.js b/lib/executor.js index 5251d3f..43b2fca 100644 --- a/lib/executor.js +++ b/lib/executor.js @@ -231,13 +231,18 @@ function runScripts(app, list, callback) { var functions = []; list.forEach(function(filepath) { debug('Requiring script %s', filepath); - var exports = require(filepath); - if (typeof exports === 'function') { - debug('Exported function detected %s', filepath); - functions.push({ - path: filepath, - func: exports - }); + try { + var exports = require(filepath); + if (typeof exports === 'function') { + debug('Exported function detected %s', filepath); + functions.push({ + path: filepath, + func: exports + }); + } + } catch (err) { + console.error('Failed loading boot script: %s\n%s', filepath, err.stack); + throw err; } });