File tree Expand file tree Collapse file tree 2 files changed +26
-36
lines changed
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge Expand file tree Collapse file tree 2 files changed +26
-36
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ package com.facebook.react.bridge
9
+
10
+ /* *
11
+ * Abstract base for a Runnable that should have any RuntimeExceptions it throws handled by the
12
+ * [JSExceptionHandler] registered if the app is in dev mode.
13
+ */
14
+ public abstract class GuardedRunnable (private val exceptionHandler : JSExceptionHandler ) : Runnable {
15
+ public constructor (reactContext: ReactContext ) : this (reactContext.exceptionHandler)
16
+
17
+ final override fun run () {
18
+ try {
19
+ runGuarded()
20
+ } catch (e: RuntimeException ) {
21
+ exceptionHandler.handleException(e)
22
+ }
23
+ }
24
+
25
+ public abstract fun runGuarded ()
26
+ }
You can’t perform that action at this time.
0 commit comments