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
gerkai committed Apr 25, 2022
1 parent 7d31061 commit 4723781
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/config.js
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 4723781

Please sign in to comment.