Skip to content

Commit

Permalink
fix(config): add file path to error message when parsing fails (nodej…
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Apr 25, 2022
1 parent 03b4b70 commit 7c73862
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export function getMergedConfig(dir, home) {

export function getConfig(configType, dir) {
const configPath = getConfigPath(configType, dir);
return readJson(configPath);
try {
return readJson(configPath);
} catch (cause) {
throw new Error('Unable to parse config file ' + configPath, { cause });
}
};

export function getConfigPath(configType, dir) {
Expand Down

0 comments on commit 7c73862

Please sign in to comment.