From ea0e7a36961f0f9c944011a3c3824d931c165e7e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 21 Sep 2022 17:20:54 -0400 Subject: [PATCH] *add error including path if json parse fails --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index c420d59..33e8bc9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -147,7 +147,7 @@ export default class Config { json = JSON.parse(json); } catch (e) { 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`);