From 5037ad6b0b2ab42e249cc9f5b5a296b84432d8aa Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 18 May 2018 00:55:50 -0600 Subject: [PATCH] improve error message as per https://git.coolaj86.com/coolaj86/greenlock.js/issues/12 --- node.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/node.js b/node.js index e844a5b..fa26105 100644 --- a/node.js +++ b/node.js @@ -22,15 +22,20 @@ ACME.challengeTests = { return true; } - err = new Error("self check does not pass"); - err.code = 'E_RETRY'; + err = new Error( + "Error: Failed HTTP-01 Dry Run.\n" + + "curl '" + url + "' does not return '" + auth.keyAuthorization + "'\n" + + "See https://git.coolaj86.com/coolaj86/acme-v2.js/issues/4" + ); + err.code = 'E_FAIL_DRY_CHALLENGE'; return Promise.reject(err); }); } , 'dns-01': function (me, auth) { + var hostname = ACME.challengePrefixes['dns-01'] + '.' + auth.hostname; return me._dig({ type: 'TXT' - , name: ACME.challengePrefixes['dns-01'] + '.' + auth.hostname + , name: hostname }).then(function (ans) { var err; @@ -40,8 +45,12 @@ ACME.challengeTests = { return true; } - err = new Error("self check does not pass"); - err.code = 'E_RETRY'; + err = new Error( + "Error: Failed DNS-01 Dry Run.\n" + + "dig TXT '" + hostname + "' does not return '" + auth.dnsAuthorization + "'\n" + + "See https://git.coolaj86.com/coolaj86/acme-v2.js/issues/4" + ); + err.code = 'E_FAIL_DRY_CHALLENGE'; return Promise.reject(err); }); }