Fixed parseSettings certificates parsing problem

Removed old reject (which was undefined);
Forwarded error to .catch and selected the message type
This commit is contained in:
alexandercerutti
2018-09-23 12:00:31 +02:00
parent d57e2abd71
commit cfbff4ba6e

View File

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