mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +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);
|
let pem = parsePEM(file, options.certificates[certName].passphrase);
|
||||||
|
|
||||||
if (!pem) {
|
if (!pem) {
|
||||||
return reject(errors.INVALID_CERTS)
|
throw new Error(errors.INVALID_CERTS.replace("%s", optCertsNames[index]));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Certificates[certName] = pem;
|
this.Certificates[certName] = pem;
|
||||||
});
|
});
|
||||||
}).catch(err => {
|
}).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