Skip to content

Commit

Permalink
0002854: Stack trace and empty message when registration is not open
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Oct 11, 2016
1 parent 9fec0d6 commit 22052f0
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -61,6 +61,7 @@
import org.jumpmind.symmetric.statistic.IStatisticManager;
import org.jumpmind.symmetric.transport.ConnectionRejectedException;
import org.jumpmind.symmetric.transport.ITransportManager;
import org.jumpmind.symmetric.transport.ServiceUnavailableException;
import org.jumpmind.util.AppUtils;
import org.jumpmind.util.RandomTimeSlot;

Expand Down Expand Up @@ -405,8 +406,7 @@ public void markNodeAsRegistered(String nodeId) {
private void sleepBeforeRegistrationRetry() {
long sleepTimeInMs = DateUtils.MILLIS_PER_SECOND
* randomTimeSlot.getRandomValueSeededByExternalId();
log.info("Could not register. Sleeping before attempting again.", sleepTimeInMs);
log.info("Sleeping for {}ms", sleepTimeInMs);
log.info("Could not register. Sleeping for {}ms before attempting again.", sleepTimeInMs);
AppUtils.sleep(sleepTimeInMs);
}

Expand All @@ -429,11 +429,15 @@ public void registerWithServer() {
} catch (ConnectException e) {
log.warn("The request to register failed because the client failed to connect to the server. The connection error message was: {}", e.getMessage());
} catch (UnknownHostException e) {
log.warn("The request to register failed because the host was unknown. The unknow host exception was {}", e.getMessage());
log.warn("The request to register failed because the host was unknown. The unknown host exception was {}", e.getMessage());
} catch (ConnectionRejectedException ex) {
log.warn("The request to register was rejected by the server. Either the server node is not started, the server is not configured properly or the registration url is incorrect");
} catch (RegistrationNotOpenException e) {
log.warn("Unable to register with server because registration is not open.");
} catch (ServiceUnavailableException e) {
log.warn("Unable to register with server because the service is not available. It may be starting up.");
} catch (Exception e) {
log.error("", e);
log.error("Unexpected error during registration: " + (StringUtils.isNotBlank(e.getMessage()) ? e.getMessage() : e.getClass().getName()), e);
}

maxNumberOfAttempts--;
Expand Down

0 comments on commit 22052f0

Please sign in to comment.