From f6fcc1635ffb45fcb9a6d4577937526afef94cd5 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 21 Aug 2023 04:00:56 -0700 Subject: [PATCH] Silence background plugin timeout Summary: This isn't actionable and can't be deduplicated due to the device identifier. Changelog: Don't report errors related to timeouts of background plugins Reviewed By: lblasa Differential Revision: D48467028 fbshipit-source-id: 94f32848962d8d3e3b1998a88f6f30a6cf86c4f6 --- .../flipper-frontend-core/src/AbstractClient.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/desktop/flipper-frontend-core/src/AbstractClient.tsx b/desktop/flipper-frontend-core/src/AbstractClient.tsx index 6e533b397..5c4f34b15 100644 --- a/desktop/flipper-frontend-core/src/AbstractClient.tsx +++ b/desktop/flipper-frontend-core/src/AbstractClient.tsx @@ -226,8 +226,17 @@ export default abstract class AbstractClient extends EventEmitter { this.startPluginIfNeeded(await this.getPlugin(pluginId)), ), ); - const newBackgroundPlugins = await this.getBackgroundPlugins(); - this.backgroundPlugins = new Set(newBackgroundPlugins); + let newBackgroundPlugins: PluginsArr = []; + try { + newBackgroundPlugins = await this.getBackgroundPlugins(); + this.backgroundPlugins = new Set(newBackgroundPlugins); + } catch (e: unknown) { + if ((e as Error).message.includes('timeout')) { + console.warn(e); + } else { + throw e; + } + } // diff the background plugin list, disconnect old, connect new ones oldBackgroundPlugins.forEach((plugin) => { if (!this.backgroundPlugins.has(plugin)) {