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,13 +231,18 @@ 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);
|
||||||
var exports = require(filepath);
|
try {
|
||||||
if (typeof exports === 'function') {
|
var exports = require(filepath);
|
||||||
debug('Exported function detected %s', filepath);
|
if (typeof exports === 'function') {
|
||||||
functions.push({
|
debug('Exported function detected %s', filepath);
|
||||||
path: filepath,
|
functions.push({
|
||||||
func: exports
|
path: filepath,
|
||||||
});
|
func: exports
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed loading boot script: %s\n%s', filepath, err.stack);
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue