From d4597f455eaa9fa22cd55654073dea3b56a41eee Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Tue, 19 Jul 2022 06:09:55 -0700 Subject: [PATCH] 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 --- desktop/plugins/public/layout/Inspector.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/desktop/plugins/public/layout/Inspector.tsx b/desktop/plugins/public/layout/Inspector.tsx index 78c0037c6..a56e31b58 100644 --- a/desktop/plugins/public/layout/Inspector.tsx +++ b/desktop/plugins/public/layout/Inspector.tsx @@ -128,7 +128,7 @@ export default class Inspector extends Component { this.updateElement(root.id, {...root, expanded: true}); 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.call().INVALIDATE, @@ -319,7 +319,7 @@ export default class Inspector extends Component { selected: false, }) .catch((e) => { - console.error(`[Layout] Failed to fetch nodes from app:`, e); + console.debug(`[Layout] Failed to fetch nodes from app:`, e); return {elements: []}; }); if (!elements) { @@ -414,10 +414,12 @@ export default class Inspector extends Component { if (!this.props.client.isConnected) { return; } - this.props.client.call(this.call().SET_HIGHLIGHTED, { - id: key, - isAlignmentMode: this.props.inAlignmentMode, - }); + this.props.client + .call(this.call().SET_HIGHLIGHTED, { + id: key, + isAlignmentMode: this.props.inAlignmentMode, + }) + .catch((e) => console.debug('[Layout] setHighlighted failed:', e)); }); onElementExpanded = ( @@ -437,7 +439,7 @@ export default class Inspector extends Component { ); } }) - .catch((e) => console.error('[layout] getChildren failed:', e)); + .catch((e) => console.debug('[Layout] getChildren failed:', e)); if (!shouldExpand) { this.updateElement(id, {expanded: shouldExpand}); }