*add error including path if json parse fails
This commit is contained in:
parent
935a225e57
commit
ea0e7a3696
|
@ -147,7 +147,7 @@ export default class Config {
|
||||||
json = JSON.parse(json);
|
json = JSON.parse(json);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === "ENOENT") return;
|
if (e.code === "ENOENT") return;
|
||||||
throw e;
|
throw new Error(`Error parsing file ${file}: ${e.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(typeof json === "object", `Config file ${file} must be an object`);
|
assert(typeof json === "object", `Config file ${file} must be an object`);
|
||||||
|
|
Loading…
Reference in New Issue