catch error
This commit is contained in:
parent
7aed0b8c3e
commit
b0f198fc6f
1 changed files with 15 additions and 9 deletions
24
core/core.ts
24
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));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue