Merge pull request #115 from clarkbw/bad-require
add console.error message to a bad require in a boot script
This commit is contained in:
commit
80831cdaaf
|
@ -231,6 +231,7 @@ function runScripts(app, list, callback) {
|
||||||
var functions = [];
|
var functions = [];
|
||||||
list.forEach(function(filepath) {
|
list.forEach(function(filepath) {
|
||||||
debug('Requiring script %s', filepath);
|
debug('Requiring script %s', filepath);
|
||||||
|
try {
|
||||||
var exports = require(filepath);
|
var exports = require(filepath);
|
||||||
if (typeof exports === 'function') {
|
if (typeof exports === 'function') {
|
||||||
debug('Exported function detected %s', filepath);
|
debug('Exported function detected %s', filepath);
|
||||||
|
@ -239,6 +240,10 @@ function runScripts(app, list, callback) {
|
||||||
func: exports
|
func: exports
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed loading boot script: %s\n%s', filepath, err.stack);
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
async.eachSeries(functions, function(f, done) {
|
async.eachSeries(functions, function(f, done) {
|
||||||
|
|
Loading…
Reference in New Issue