Ver a proveniência

Add more logs of api exception

pull/20/head
Kristijan Mitrovic há 4 anos
ascendente
cometimento
504785e7e8
1 ficheiros alterados com 11 adições e 0 eliminações
  1. +11
    -0
      bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java

+ 11
- 0
bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java Ver ficheiro

@@ -48,6 +48,7 @@ import org.cobbzilla.util.io.TempDir;
import org.cobbzilla.util.system.Command;
import org.cobbzilla.util.system.CommandResult;
import org.cobbzilla.util.system.CommandShell;
import org.cobbzilla.wizard.api.ApiException;
import org.cobbzilla.wizard.cache.redis.RedisService;
import org.cobbzilla.wizard.validation.MultiViolationException;
import org.cobbzilla.wizard.validation.SimpleViolationException;
@@ -352,6 +353,7 @@ public class StandardNetworkService implements NetworkService {
// wait for node to be ready
final long readyStart = now();
boolean ready = false;
Exception lastEx = null;
BubbleNodeClient nodeClient = null;
while (now() - readyStart < NODE_READY_TIMEOUT) {
sleep(SECONDS.toMillis(2), "newNode: waiting for node ("+node.id()+") to be ready");
@@ -365,9 +367,18 @@ public class StandardNetworkService implements NetworkService {
}
} catch (Exception e) {
log.warn("newNode: node ("+node.id()+") error checking if ready: "+shortError(e));
lastEx = e;
}
}
if (!ready) {
if (lastEx != null) {
var responseStatus = "";
if (lastEx instanceof ApiException) {
responseStatus = " (HTTP status: "
+ String.valueOf(((ApiException) lastEx).getResponse().status) + ")";
}
log.warn("newNode: the last exception in checking if ready" + responseStatus, lastEx);
}
return die("newNode: timeout waiting for node ("+node.id()+") to be ready");
}



Carregando…
Cancelar
Guardar