Skip to content

Commit bd8e72b

Browse files
committed
Fix polling recoverable logic error.
1 parent 71130ac commit bd8e72b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/PollingBase.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ protected CompletableFuture<FDv2SourceResult> poll(Selector selector, boolean on
3535
if (ex instanceof HttpErrors.HttpErrorException) {
3636
HttpErrors.HttpErrorException e = (HttpErrors.HttpErrorException) ex;
3737
DataSourceStatusProvider.ErrorInfo errorInfo = DataSourceStatusProvider.ErrorInfo.fromHttpError(e.getStatus());
38-
boolean recoverable = e.getStatus() > 0 && !isHttpErrorRecoverable(e.getStatus());
38+
// Errors without an HTTP status are recoverable. If there is a status, then we check if the error
39+
// is recoverable.
40+
boolean recoverable = e.getStatus() <= 0 || isHttpErrorRecoverable(e.getStatus());
3941
logger.error("Polling request failed with HTTP error: {}", e.getStatus());
4042
// For a one-shot request all errors are terminal.
4143
if (oneShot) {

0 commit comments

Comments
 (0)