Skip to content

Commit 7c73862

Browse files
authoredApr 25, 2022
fix(config): add file path to error message when parsing fails (#608)
1 parent 03b4b70 commit 7c73862

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎lib/config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export function getMergedConfig(dir, home) {
2525

2626
export function getConfig(configType, dir) {
2727
const configPath = getConfigPath(configType, dir);
28-
return readJson(configPath);
28+
try {
29+
return readJson(configPath);
30+
} catch (cause) {
31+
throw new Error('Unable to parse config file ' + configPath, { cause });
32+
}
2933
};
3034

3135
export function getConfigPath(configType, dir) {

0 commit comments

Comments
 (0)
Please sign in to comment.