mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Collect more diagnostics when addViewAt crashes
Summary: Making error more explicit to assist in debugging. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D22929047 fbshipit-source-id: 4f26668a96868e7c5865a587142c3bcd10a26c90
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6c01f26d27
commit
7bf6196408
@@ -156,7 +156,19 @@ public class MountingManager {
|
||||
logViewHierarchy(parentView);
|
||||
}
|
||||
|
||||
getViewGroupManager(parentViewState).addView(parentView, view, index);
|
||||
try {
|
||||
getViewGroupManager(parentViewState).addView(parentView, view, index);
|
||||
} catch (IllegalStateException e) {
|
||||
// Wrap error with more context for debugging
|
||||
throw new IllegalStateException(
|
||||
"addViewAt: failed to insert view ["
|
||||
+ tag
|
||||
+ "] into parent ["
|
||||
+ parentTag
|
||||
+ "] at index "
|
||||
+ index,
|
||||
e);
|
||||
}
|
||||
|
||||
// Display children after inserting
|
||||
if (SHOW_CHANGED_VIEW_HIERARCHIES) {
|
||||
|
||||
Reference in New Issue
Block a user