Be more specific with missing property error message
This commit is contained in:
parent
5b14f2a1f1
commit
370de9ce9b
10
index.js
10
index.js
|
@ -204,8 +204,14 @@ LE.create = function (le) {
|
||||||
if (!le.approveDomains) {
|
if (!le.approveDomains) {
|
||||||
le.approvedDomains = le.approvedDomains || [];
|
le.approvedDomains = le.approvedDomains || [];
|
||||||
le.approveDomains = function (lexOpts, certs, cb) {
|
le.approveDomains = function (lexOpts, certs, cb) {
|
||||||
if (!(le.approvedDomains.length && le.email && le.agreeTos)) {
|
if (!le.email) {
|
||||||
throw new Error("le-sni-auto is not properly configured. Missing one or more of approveDomains(domain, certs, callback) or approvedDomains (array), email, or agreeTos");
|
throw new Error("le-sni-auto is not properly configured. Missing email");
|
||||||
|
}
|
||||||
|
if (!le.agreeTos) {
|
||||||
|
throw new Error("le-sni-auto is not properly configured. Missing agreeTos");
|
||||||
|
}
|
||||||
|
if (!le.approvedDomains.length) {
|
||||||
|
throw new Error("le-sni-auto is not properly configured. Missing approveDomains(domain, certs, callback)");
|
||||||
}
|
}
|
||||||
if (lexOpts.domains.every(function (domain) {
|
if (lexOpts.domains.every(function (domain) {
|
||||||
return -1 !== le.approvedDomains.indexOf(domain);
|
return -1 !== le.approvedDomains.indexOf(domain);
|
||||||
|
|
Loading…
Reference in New Issue