Skip to content

Commit 9eb75d4

Browse files
alanjhughesfacebook-github-bot
authored andcommitted
Change exception handele type in ReleaseDevSupportManager (#50400)
Summary: In expo-updates, we would like to handle exceptions on app launch. We used to do this by reassigning our own `DefaultJSExceptionHandler` to the property on the `ReleaseDevSupportManager `. This class has been migrated to kotlin and is now final so we can no longer do this. Instead of having the `defaultJSExceptionHandler` typed as `DefaultJSExceptionHandler` we'd like to change it to the interface, `JSExceptionHandler` so we can do this https://github.com/expo/expo/blob/93b7e9b1724a7be11b9d79c0313a2e5a2fd5e5bf/packages/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt#L118C82-L118C97 ## Changelog: [ANDROID] [CHANGED] Change `defaultJSExceptionHandler`'s type to `JSExceptionHandler` on the `ReleaseDevSupportManager` Pull Request resolved: #50400 Test Plan: RNTester runs without issue in a release build. Reviewed By: huntie Differential Revision: D72173667 Pulled By: cortinico fbshipit-source-id: 978fd696322432e638a90014ff3c8c2b09fae761
1 parent 09d2195 commit 9eb75d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import android.app.Activity
1111
import android.util.Pair
1212
import android.view.View
1313
import com.facebook.react.bridge.DefaultJSExceptionHandler
14+
import com.facebook.react.bridge.JSExceptionHandler
1415
import com.facebook.react.bridge.ReactContext
1516
import com.facebook.react.bridge.ReadableArray
1617
import com.facebook.react.common.SurfaceDelegate
@@ -34,7 +35,7 @@ import java.io.File
3435
*/
3536
public open class ReleaseDevSupportManager : DevSupportManager {
3637

37-
private val defaultJSExceptionHandler: DefaultJSExceptionHandler = DefaultJSExceptionHandler()
38+
private val defaultJSExceptionHandler: JSExceptionHandler = DefaultJSExceptionHandler()
3839

3940
public override fun showNewJavaError(message: String?, e: Throwable): Unit = Unit
4041

0 commit comments

Comments
 (0)