catch error

This commit is contained in:
Nate 2025-04-22 15:01:21 -07:00
parent 7aed0b8c3e
commit b0f198fc6f

View file

@ -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));