Skip to content

Commit

Permalink
Don't swallow config parsing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Jul 27, 2019
1 parent 8b32619 commit 9e190c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = function getConfig() {
console.log(config);
return config;
} catch (e) {
console.log(`[WARNING] Didn't find config at ${configPath}\n`);
return {};
if (e.code == 'MODULE_NOT_FOUND') {
console.warn(`[WARNING] Didn't find config at ${configPath}\n`);
return {};
}
throw e;
}
}

0 comments on commit 9e190c3

Please sign in to comment.