From 370de9ce9bd126b3929b6da4348fa9bff450363c Mon Sep 17 00:00:00 2001 From: Tim Caswell Date: Tue, 18 Apr 2017 16:42:47 -0500 Subject: [PATCH] Be more specific with missing property error message --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0e5bdd2..ad7a3f0 100644 --- a/index.js +++ b/index.js @@ -204,8 +204,14 @@ LE.create = function (le) { if (!le.approveDomains) { le.approvedDomains = le.approvedDomains || []; le.approveDomains = function (lexOpts, certs, cb) { - if (!(le.approvedDomains.length && le.email && le.agreeTos)) { - 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"); + if (!le.email) { + 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) { return -1 !== le.approvedDomains.indexOf(domain);