Skip to content

Commit

Permalink
fix(config): add file path to error message when parsing fails (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alicia Lopez committed Apr 25, 2022
1 parent 5d32ca4 commit 3967c0a
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 3967c0a

Please sign in to comment.