mirror of https://github.com/shred/acme4j
Enhance documentation about error handling
parent
91898ed7d1
commit
d5305aae36
|
@ -121,6 +121,7 @@ public class ClientTest {
|
|||
while (order.getStatus() != Status.VALID && attempts-- > 0) {
|
||||
// Did the order fail?
|
||||
if (order.getStatus() == Status.INVALID) {
|
||||
LOG.error("Order has failed, reason: {}", order.getError());
|
||||
throw new AcmeException("Order failed... Giving up.");
|
||||
}
|
||||
|
||||
|
@ -271,6 +272,7 @@ public class ClientTest {
|
|||
while (challenge.getStatus() != Status.VALID && attempts-- > 0) {
|
||||
// Did the authorization fail?
|
||||
if (challenge.getStatus() == Status.INVALID) {
|
||||
LOG.error("Challenge has failed, reason: {}", challenge.getError());
|
||||
throw new AcmeException("Challenge failed... Giving up.");
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ public void fetchCertificate(Collection<String> domains)
|
|||
while (order.getStatus() != Status.VALID && attempts-- > 0) {
|
||||
// Did the order fail?
|
||||
if (order.getStatus() == Status.INVALID) {
|
||||
LOG.error("Order has failed, reason: {}", order.getError());
|
||||
throw new AcmeException("Order failed... Giving up.");
|
||||
}
|
||||
|
||||
|
@ -260,6 +261,7 @@ private void authorize(Authorization auth)
|
|||
while (challenge.getStatus() != Status.VALID && attempts-- > 0) {
|
||||
// Did the authorization fail?
|
||||
if (challenge.getStatus() == Status.INVALID) {
|
||||
LOG.error("Challenge has failed, reason: {}", challenge.getError());
|
||||
throw new AcmeException("Challenge failed... Giving up.");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ Order order = account.newOrder()
|
|||
!!! note
|
||||
The number of domains per certificate may be limited. See your CA's documentation for the limits.
|
||||
|
||||
The `Order` resource contains a collection of `Authorization`s that can be read from the `getAuthorizations()` method. You must process _all of them_ in order to get the certificate, except those with a `VALID` status.
|
||||
The `Order` resource contains a collection of `Authorization`s that can be read from the `getAuthorizations()` method. In order to get the certificate, you must process _all of them_ that are in a `PENDING` state.
|
||||
|
||||
```java
|
||||
for (Authorization auth : order.getAuthorizations()) {
|
||||
if (auth.getStatus() != Status.VALID) {
|
||||
if (auth.getStatus() == Status.PENDING) {
|
||||
processAuth(auth);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue