From e3bf2e4add0f5151304b57f29a56dfb34f39572f Mon Sep 17 00:00:00 2001 From: alexandercerutti Date: Mon, 23 Jul 2018 18:13:02 +0200 Subject: [PATCH] Replaced exception throw with Promise Rejection --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index fab9d6e..b0ada0d 100644 --- a/index.js +++ b/index.js @@ -465,7 +465,13 @@ class Pass { contents.forEach(file => { let pem = this.__parsePEM(file, options.certificates.signerKey.passphrase); if (!pem.key || !pem.value) { - throw new Error("Invalid certificates got loaded. Please provide WWDR certificates and developer signer certificate and key (with passphrase)."); + return reject({ + status: false, + error: { + message: "Invalid certificates got loaded. Please provide WWDR certificates and developer signer certificate and key (with passphrase).", + ecode: 418 + } + }) } this.Certificates[pem.key] = pem.value;