From cfbff4ba6e9f7696795360e6635a2829127f1994 Mon Sep 17 00:00:00 2001 From: alexandercerutti Date: Sun, 23 Sep 2018 12:00:31 +0200 Subject: [PATCH] Fixed parseSettings certificates parsing problem Removed old reject (which was undefined); Forwarded error to .catch and selected the message type --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index efbd674..b316d42 100644 --- a/index.js +++ b/index.js @@ -613,13 +613,17 @@ class Pass { let pem = parsePEM(file, options.certificates[certName].passphrase); if (!pem) { - return reject(errors.INVALID_CERTS) + throw new Error(errors.INVALID_CERTS.replace("%s", optCertsNames[index])); } this.Certificates[certName] = pem; }); }).catch(err => { - throw new Error(errors.INVALID_CERTS); + if (!err.path) { + throw err; + } else { + throw new Error(errors.INVALID_CERT_PATH.replace("%s", path.parse(err.path).base)); + } }); }