Skip to content

Commit 66a7e23

Browse files
committed
add exception handler
1 parent bd8aaa2 commit 66a7e23

File tree

1 file changed

+4
-4
lines changed
  • analytics-kotlin-live/src/main/java/com/segment/analytics/liveplugins/kotlin

1 file changed

+4
-4
lines changed

analytics-kotlin-live/src/main/java/com/segment/analytics/liveplugins/kotlin/LivePlugins.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import java.lang.ref.WeakReference
2222
import java.util.concurrent.CopyOnWriteArrayList
2323
import kotlin.coroutines.CoroutineContext
2424
import androidx.core.content.edit
25+
import com.segment.analytics.substrata.kotlin.JSExceptionHandler
2526
import kotlinx.serialization.json.decodeFromJsonElement
2627

2728
interface LivePluginsDependent {
@@ -37,7 +38,8 @@ data class LivePluginsSettings(
3738

3839
class LivePlugins(
3940
private val fallbackFile: InputStream? = null,
40-
private val forceFallbackFile: Boolean = false
41+
private val forceFallbackFile: Boolean = false,
42+
exceptionHandler: JSExceptionHandler? = null
4143
) : EventPlugin, WaitingPlugin {
4244
override val type: Plugin.Type = Plugin.Type.Utility
4345

@@ -50,9 +52,7 @@ class LivePlugins(
5052

5153
private lateinit var sharedPreferences: SharedPreferences
5254

53-
val engine = JSScope {
54-
it.printStackTrace()
55-
}
55+
val engine = JSScope(exceptionHandler = exceptionHandler)
5656

5757
private lateinit var livePluginFile: File
5858

0 commit comments

Comments
 (0)