*add error including path if json parse fails

This commit is contained in:
Derrick Hammer 2022-09-21 17:20:54 -04:00
parent 935a225e57
commit ea0e7a3696
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -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`);