Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 8c554ad

Browse files
committed
added logging around state during reconnect
1 parent e8e7ff0 commit 8c554ad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/launchdarkly/client/EventSource.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ private static enum State {
7575
* a static {@link EventSource#target(javax.ws.rs.client.WebTarget) EventSource.target(endpoint)} factory method.
7676
* <p>
7777
* For example:
78+
* </p>
7879
* <pre>
7980
* EventSource es = EventSource.target(endpoint).named("my source")
8081
* .reconnectingEvery(5, SECONDS)
8182
* .open();
8283
* </pre>
83-
* </p>
8484
*
8585
* @since 2.3
8686
*/
@@ -497,12 +497,15 @@ public void run() {
497497
EventInput eventInput = null;
498498
try {
499499
try {
500+
logger.debug("current state is {0}", state.get());
500501
final Invocation.Builder request = prepareHandshakeRequest();
501502
if (state.get() == State.OPEN) { // attempt to connect only if even source is open
502503
logger.debug("Connecting...");
503504
eventInput = request.get(EventInput.class);
504505
logger.debug("Connected!");
505506
}
507+
} catch (Exception e) {
508+
logger.warn("Encountered error trying to connect", e);
506509
} finally {
507510
if (firstContactSignal != null) {
508511
// release the signal regardless of event source state or connection request outcome

0 commit comments

Comments
 (0)