Return after rejecting, catch and log
This commit is contained in:
parent
82f179b07c
commit
cd1f5fd04a
1 changed files with 7 additions and 1 deletions
|
@ -246,8 +246,9 @@ function start(opts) {
|
|||
startupPromises.push(new Promise(function(resolve, reject) {
|
||||
fs.readFile(templateFile, function(err, content) {
|
||||
if (err) {
|
||||
console.error('Template not found:', err);
|
||||
err = new Error('Template not found: ' + err.message);
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
var compiled = handlebars.compile(content.toString());
|
||||
|
||||
|
@ -415,6 +416,11 @@ function start(opts) {
|
|||
module.exports = function(opts) {
|
||||
var running = start(opts);
|
||||
|
||||
running.startupPromise.catch(function(err) {
|
||||
console.error(err.message);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('SIGINT', function() {
|
||||
process.exit();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue