From aa324e2a297223ca3255e7c6a0f6344fd98bab2e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 10 Jan 2020 16:55:44 -0700 Subject: [PATCH] v3.0.9: bugfix error handling --- acme.js | 9 ++++++++- maintainers.js | 29 ++++++++++++++--------------- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/acme.js b/acme.js index a5cb9b0..3d829a7 100644 --- a/acme.js +++ b/acme.js @@ -775,7 +775,14 @@ ACME._postChallenge = function(me, options, kid, auth) { // REMOVE DNS records as soon as the state is non-processing // (valid or invalid or other) try { - options.challenges[auth.type].remove({ challenge: auth }); + options.challenges[auth.type] + .remove({ challenge: auth }) + .catch(function(err) { + err.action = 'challenge_remove'; + err.altname = auth.altname; + err.type = auth.type; + ACME._notify(me, options, 'error', err); + }); } catch (e) {} if ('valid' === resp.body.status) { diff --git a/maintainers.js b/maintainers.js index 437eb10..61719a1 100644 --- a/maintainers.js +++ b/maintainers.js @@ -33,8 +33,8 @@ M.init = function(me) { }; M._init = function(me, tz, locale) { - // prevent a stampede from misconfigured clients in an eternal loop setTimeout(function() { + // prevent a stampede from misconfigured clients in an eternal loop me.request({ method: 'GET', url: 'https://api.rootprojects.org/api/nonce', @@ -60,20 +60,19 @@ M._init = function(me, tz, locale) { locale: locale } }; - return me - .request(req) - .catch(function(err) { - if (me.debug) { - console.error( - 'error adding maintainer to support notices:' - ); - console.error(err); - } - }) - .then(function(/*resp*/) { - oldCollegeTries[me.maintainerEmail] = true; - //console.log(resp); - }); + return me.request(req); + }) + .catch(function(err) { + if (me.debug) { + console.error( + 'error adding maintainer to support notices:' + ); + console.error(err); + } + }) + .then(function(/*resp*/) { + oldCollegeTries[me.maintainerEmail] = true; + //console.log(resp); }); }, me.__timeout || 3000); }; diff --git a/package-lock.json b/package-lock.json index cdd75af..de0e90d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@root/acme", - "version": "3.0.8", + "version": "3.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f9c455b..0a8aff4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@root/acme", - "version": "3.0.8", + "version": "3.0.9", "description": "Free SSL certificates for Node.js and Browsers. Issued via Let's Encrypt", "homepage": "https://rootprojects.org/acme/", "main": "acme.js",