From b0f198fc6faa901f4fbb45978e9a82d1dcc7ac92 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 22 Apr 2025 15:01:21 -0700 Subject: [PATCH] catch error --- core/core.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/core/core.ts b/core/core.ts index 8e370fde8..c17c330d3 100644 --- a/core/core.ts +++ b/core/core.ts @@ -408,15 +408,21 @@ export class Core { if (!config) { return []; } - const items = await config.contextProviders - ?.find((provider) => provider.description.title === msg.data.title) - ?.loadSubmenuItems({ - config, - ide: this.ide, - fetch: (url, init) => - fetchwithRequestOptions(url, init, config.requestOptions), - }); - return items || []; + + try { + const items = await config.contextProviders + ?.find((provider) => provider.description.title === msg.data.title) + ?.loadSubmenuItems({ + config, + ide: this.ide, + fetch: (url, init) => + fetchwithRequestOptions(url, init, config.requestOptions), + }); + return items || []; + } catch (e) { + console.error(e); + return []; + } }); on("context/getContextItems", this.getContextItems.bind(this));