Merge pull request #3 from martinheidegger/detailed-error-message
Added error handler details.
This commit is contained in:
commit
3babc27847
|
@ -200,7 +200,7 @@ module.exports.create = function (deps) {
|
|||
}
|
||||
|
||||
function ensureValidation(err, res, body, unlink) {
|
||||
var authz;
|
||||
var authz, challengesState;
|
||||
|
||||
if (err || Math.floor(res.statusCode/100)!==2) {
|
||||
unlink();
|
||||
|
@ -235,7 +235,17 @@ module.exports.create = function (deps) {
|
|||
nextDomain();
|
||||
} else if (authz.status==='invalid') {
|
||||
unlink();
|
||||
return handleErr(null, 'The CA was unable to validate the file you provisioned: ' + authz.detail, body);
|
||||
challengesState = state.challenges.map(function (challenge) {
|
||||
var result = ' - ' + challenge.uri + ' [' + challenge.status + ']';
|
||||
if (result.error) {
|
||||
result += '\n ' + result.error.detail;
|
||||
}
|
||||
return result;
|
||||
}).join('\n');
|
||||
return handleErr(null,
|
||||
'The CA was unable to validate the file you provisioned. '
|
||||
+ (authz.detail ? 'Details: ' + authz.detail : '')
|
||||
+ (challengesState ? '\n' + challengesState : ''), body);
|
||||
} else {
|
||||
unlink();
|
||||
return handleErr(null, 'CA returned an authorization in an unexpected state' + authz.detail, authz);
|
||||
|
|
Loading…
Reference in New Issue