Add a handler for any errors during highlight

Summary:
^

Ignore the errors as otherwise it may cause unhandled rejection errors.

Reviewed By: aigoncharov

Differential Revision: D37926740

fbshipit-source-id: 50476378b4d254e28af953979fbedad1113e43aa
This commit is contained in:
Lorenzo Blasa
2022-07-19 06:09:55 -07:00
committed by Facebook GitHub Bot
parent bc74a58aab
commit d4597f455e

View File

@@ -128,7 +128,7 @@ export default class Inspector extends Component<Props, State> {
this.updateElement(root.id, {...root, expanded: true}); this.updateElement(root.id, {...root, expanded: true});
this.performInitialExpand(root); this.performInitialExpand(root);
}) })
.catch((e) => console.error('[layout] GET_ROOT failed:', e)); .catch((e) => console.debug('[Layout] getRoot failed:', e));
this.props.client.subscribe( this.props.client.subscribe(
this.call().INVALIDATE, this.call().INVALIDATE,
@@ -319,7 +319,7 @@ export default class Inspector extends Component<Props, State> {
selected: false, selected: false,
}) })
.catch((e) => { .catch((e) => {
console.error(`[Layout] Failed to fetch nodes from app:`, e); console.debug(`[Layout] Failed to fetch nodes from app:`, e);
return {elements: []}; return {elements: []};
}); });
if (!elements) { if (!elements) {
@@ -414,10 +414,12 @@ export default class Inspector extends Component<Props, State> {
if (!this.props.client.isConnected) { if (!this.props.client.isConnected) {
return; return;
} }
this.props.client.call(this.call().SET_HIGHLIGHTED, { this.props.client
.call(this.call().SET_HIGHLIGHTED, {
id: key, id: key,
isAlignmentMode: this.props.inAlignmentMode, isAlignmentMode: this.props.inAlignmentMode,
}); })
.catch((e) => console.debug('[Layout] setHighlighted failed:', e));
}); });
onElementExpanded = ( onElementExpanded = (
@@ -437,7 +439,7 @@ export default class Inspector extends Component<Props, State> {
); );
} }
}) })
.catch((e) => console.error('[layout] getChildren failed:', e)); .catch((e) => console.debug('[Layout] getChildren failed:', e));
if (!shouldExpand) { if (!shouldExpand) {
this.updateElement(id, {expanded: shouldExpand}); this.updateElement(id, {expanded: shouldExpand});
} }