acme2: Display any errors when cleaning up challenge
This commit is contained in:
@@ -424,9 +424,7 @@ Acme2.prototype.cleanupHttpChallenge = function (hostname, domain, challenge, ca
|
|||||||
assert.strictEqual(typeof challenge, 'object');
|
assert.strictEqual(typeof challenge, 'object');
|
||||||
assert.strictEqual(typeof callback, 'function');
|
assert.strictEqual(typeof callback, 'function');
|
||||||
|
|
||||||
safe.fs.unlinkSync(path.join(paths.ACME_CHALLENGES_DIR, challenge.token));
|
fs.unlinkSync(path.join(paths.ACME_CHALLENGES_DIR, challenge.token), callback);
|
||||||
|
|
||||||
callback();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function getChallengeSubdomain(hostname, domain) {
|
function getChallengeSubdomain(hostname, domain) {
|
||||||
@@ -567,7 +565,9 @@ Acme2.prototype.acmeFlow = function (hostname, domain, callback) {
|
|||||||
that.waitForOrder.bind(that, orderUrl),
|
that.waitForOrder.bind(that, orderUrl),
|
||||||
that.downloadCertificate.bind(that, hostname)
|
that.downloadCertificate.bind(that, hostname)
|
||||||
], function (error) {
|
], function (error) {
|
||||||
that.cleanupChallenge(hostname, domain, challenge, function () {
|
that.cleanupChallenge(hostname, domain, challenge, function (cleanupError) {
|
||||||
|
if (error) debug('acmeFlow: ignoring error when cleaning up challenge:', cleanupError);
|
||||||
|
|
||||||
iteratorCallback(error);
|
iteratorCallback(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ function del(dnsConfig, zoneName, subdomain, type, values, callback) {
|
|||||||
|
|
||||||
debug(`get: ${subdomain} in zone ${zoneName} of type ${type} with values ${JSON.stringify(values)}`);
|
debug(`get: ${subdomain} in zone ${zoneName} of type ${type} with values ${JSON.stringify(values)}`);
|
||||||
|
|
||||||
if (type !== 'A') return callback(new DomainsError(DomainsError.EXTERNAL_ERROR, new Error('Not supported by GoDaddy API'))); // can never happen
|
if (type !== 'A') return callback(new DomainsError(DomainsError.EXTERNAL_ERROR, new Error('Record deletion is not supported by GoDaddy API')));
|
||||||
|
|
||||||
// check if the record exists at all so that we don't insert the "Dead" record for no reason
|
// check if the record exists at all so that we don't insert the "Dead" record for no reason
|
||||||
get(dnsConfig, zoneName, subdomain, type, function (error, values) {
|
get(dnsConfig, zoneName, subdomain, type, function (error, values) {
|
||||||
|
|||||||
Reference in New Issue
Block a user