From fffdeedabb07e6ef02f133ed01b5cb8e488f9b3e Mon Sep 17 00:00:00 2001 From: Jonathan King Date: Wed, 20 Jul 2022 16:31:29 +0000 Subject: [PATCH] Fix: throw if not ENOENT --- lib/conf.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/conf.js b/lib/conf.js index 9be6e8e..db2a08b 100644 --- a/lib/conf.js +++ b/lib/conf.js @@ -41,7 +41,11 @@ class Conf extends ConfigChain { const contents = fs.readFileSync(file, 'utf8'); this.addString(contents, file, 'ini', marker); } catch (error) { - this.add({}, marker); + if (error.code === 'ENOENT') { + this.add({}, marker); + } else { + throw error; + } } return this;