mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
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:
8
index.js
8
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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user