error handling when service is on down or in maintenance
This commit is contained in:
parent
e8c46db062
commit
ac76249179
3
acme.js
3
acme.js
|
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue