error handling when service is on down or in maintenance #28

Open
Ghost wants to merge 1 commits from (deleted):master into master
1 changed files with 3 additions and 0 deletions
Showing only changes of commit ac76249179 - Show all commits

View File

@ -92,6 +92,9 @@ ACME.create = function create(me) {
} }
return p.then(function() { return p.then(function() {
return ACME._directory(me).then(function(resp) { return ACME._directory(me).then(function(resp) {
if (resp.type && resp.type.indexOf("error") >= 0) {
throw new Error(resp.detail);
}
return fin(resp.body); return fin(resp.body);
}); });
}); });