Skip to content

Commit

Permalink
Don't force exit on makeConfig errors (#876)
Browse files Browse the repository at this point in the history
Instead, allow error to bubble up. End result is the same when
running via CLI, but when running in another process you don't
want to force exit.
  • Loading branch information
gabegorelick authored and garris committed Oct 3, 2018
1 parent 41e50d1 commit 73699c0
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions core/util/makeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,10 @@ function loadProjectConfig (command, options, config) {
}
userConfig = options.config;
} else if (config.backstopConfigFileName) {
try {
// Remove from cache config content
+delete require.cache[require.resolve(config.backstopConfigFileName)];
console.log('Loading config: ', config.backstopConfigFileName, '\n');
userConfig = require(config.backstopConfigFileName);
} catch (e) {
console.error('Error ' + e);
process.exit(1);
}
// Remove from cache config content
delete require.cache[require.resolve(config.backstopConfigFileName)];
console.log('Loading config: ', config.backstopConfigFileName, '\n');
userConfig = require(config.backstopConfigFileName);
}
}

Expand Down

0 comments on commit 73699c0

Please sign in to comment.