Skip to content

Commit b6794ab

Browse files
authored
fix: add proper exception handling for background event source (#281)
1 parent 6bf69a3 commit b6794ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

android-client-sdk/src/main/java/com/devcycle/sdk/android/api/DevCycleClient.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.devcycle.sdk.android.util.DevCycleLogger
1111
import com.devcycle.sdk.android.util.DVCSharedPrefs
1212
import com.devcycle.sdk.android.util.LogLevel
1313
import com.launchdarkly.eventsource.ConnectStrategy
14+
import com.launchdarkly.eventsource.ErrorStrategy
1415
import com.launchdarkly.eventsource.EventSource
1516
import com.launchdarkly.eventsource.background.BackgroundEventSource
1617
import com.launchdarkly.eventsource.MessageEvent
@@ -170,7 +171,7 @@ class DevCycleClient private constructor(
170171
val builder = EventSource.Builder(
171172
ConnectStrategy.http(URI(config?.sse?.url))
172173
.readTimeout(EVENT_SOURCE_RETRY_DELAY_MIN, TimeUnit.MINUTES)
173-
)
174+
).errorStrategy(ErrorStrategy.alwaysContinue())
174175

175176
backgroundEventSource = BackgroundEventSource.Builder(handler, builder).build()
176177
backgroundEventSource?.start()

0 commit comments

Comments
 (0)