From 04db0924641f1feb729f9fff14ffeb78b625e20a Mon Sep 17 00:00:00 2001 From: Jacob Mischka Date: Wed, 24 May 2023 14:43:58 -0500 Subject: [PATCH] Catch errors in initializeHost on handleActionsChange --- src/classes/IntervalClient.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/classes/IntervalClient.ts b/src/classes/IntervalClient.ts index 7c742a3..af5635f 100644 --- a/src/classes/IntervalClient.ts +++ b/src/classes/IntervalClient.ts @@ -337,8 +337,13 @@ export default class IntervalClient { if (this.#isInitialized && !this.#reinitializeTimeout) { this.#reinitializeTimeout = setTimeout(async () => { - await this.#initializeHost() - this.#reinitializeTimeout = null + try { + await this.#initializeHost() + } catch (err) { + this.#logger.error('Failed to reinitialize on routes change', err) + } finally { + this.#reinitializeTimeout = null + } }, this.#reinitializeBatchTimeoutMs) } }