mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 09:29:07 +08:00
Adding JS hierarchy information when a StackOverflowException is thrown in Dev mode
Reviewed By: achen1 Differential Revision: D6716309 fbshipit-source-id: 23458cd126d13fec3aa9c09420f7cdd230ec8dd0
This commit is contained in:
committed by
Facebook Github Bot
parent
e8893a021f
commit
4d3519cc6a
@@ -210,7 +210,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
||||
} catch (StackOverflowError e) {
|
||||
// Adding special exception management for StackOverflowError for logging purposes.
|
||||
// This will be removed in the future.
|
||||
handleException(new IllegalViewOperationException("StackOverflowError", e));
|
||||
handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,12 +510,19 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleException(Exception e) {
|
||||
if (mReactInstanceManager != null && mReactInstanceManager.getCurrentReactContext() != null) {
|
||||
mReactInstanceManager.getCurrentReactContext().handleException(e);
|
||||
} else {
|
||||
throw new RuntimeException(e);
|
||||
public void handleException(Throwable t) {
|
||||
if (mReactInstanceManager == null
|
||||
|| mReactInstanceManager.getCurrentReactContext() == null) {
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
|
||||
// Adding special exception management for StackOverflowError for logging purposes.
|
||||
// This will be removed in the future.
|
||||
Exception e = (t instanceof StackOverflowError) ?
|
||||
new IllegalViewOperationException("StackOverflowException", this, t) :
|
||||
t instanceof Exception ? (Exception) t : new RuntimeException(t);
|
||||
|
||||
mReactInstanceManager.getCurrentReactContext().handleException(e);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user