(failedMarketplaces: Array<{
name: string;
error?: string;
}>, extraMarketplaceErrors: PluginError[], pluginLoadingErrors: PluginError[], otherErrors: PluginError[], brokenInstalledMarketplaces: Array<{
name: string;
error: string;
}>, transientErrors: PluginError[], pluginScopes: Map<string, string>)
| 209 | return undefined; |
| 210 | } |
| 211 | function buildErrorRows(failedMarketplaces: Array<{ |
| 212 | name: string; |
| 213 | error?: string; |
| 214 | }>, extraMarketplaceErrors: PluginError[], pluginLoadingErrors: PluginError[], otherErrors: PluginError[], brokenInstalledMarketplaces: Array<{ |
| 215 | name: string; |
| 216 | error: string; |
| 217 | }>, transientErrors: PluginError[], pluginScopes: Map<string, string>): ErrorRow[] { |
| 218 | const rows: ErrorRow[] = []; |
| 219 | |
| 220 | // --- Transient errors at the top (restart to retry) --- |
| 221 | for (const error of transientErrors) { |
| 222 | const pluginName = 'pluginId' in error ? error.pluginId : 'plugin' in error ? error.plugin : undefined; |
| 223 | rows.push({ |
| 224 | label: pluginName ?? error.source, |
| 225 | message: formatErrorMessage(error), |
| 226 | guidance: 'Restart to retry loading plugins', |
| 227 | action: { |
| 228 | kind: 'none' |
| 229 | } |
| 230 | }); |
| 231 | } |
| 232 | |
| 233 | // --- Marketplace errors --- |
| 234 | // Track shown marketplace names to avoid duplicates across sources |
| 235 | const shownMarketplaceNames = new Set<string>(); |
| 236 | for (const m of failedMarketplaces) { |
| 237 | shownMarketplaceNames.add(m.name); |
| 238 | const action = buildMarketplaceAction(m.name); |
| 239 | const sourceInfo = getExtraMarketplaceSourceInfo(m.name); |
| 240 | const scope = sourceInfo.isInPolicy ? 'managed' : sourceInfo.editableSources[0]?.scope; |
| 241 | rows.push({ |
| 242 | label: m.name, |
| 243 | message: m.error ?? 'Installation failed', |
| 244 | guidance: action.kind === 'managed-only' ? 'Managed by your organization — contact your admin' : undefined, |
| 245 | action, |
| 246 | scope |
| 247 | }); |
| 248 | } |
| 249 | for (const e of extraMarketplaceErrors) { |
| 250 | const marketplace = 'marketplace' in e ? e.marketplace : e.source; |
| 251 | if (shownMarketplaceNames.has(marketplace)) continue; |
| 252 | shownMarketplaceNames.add(marketplace); |
| 253 | const action = buildMarketplaceAction(marketplace); |
| 254 | const sourceInfo = getExtraMarketplaceSourceInfo(marketplace); |
| 255 | const scope = sourceInfo.isInPolicy ? 'managed' : sourceInfo.editableSources[0]?.scope; |
| 256 | rows.push({ |
| 257 | label: marketplace, |
| 258 | message: formatErrorMessage(e), |
| 259 | guidance: action.kind === 'managed-only' ? 'Managed by your organization — contact your admin' : getErrorGuidance(e), |
| 260 | action, |
| 261 | scope |
| 262 | }); |
| 263 | } |
| 264 | |
| 265 | // Installed marketplaces that fail to load data (from known_marketplaces.json) |
| 266 | for (const m of brokenInstalledMarketplaces) { |
| 267 | if (shownMarketplaceNames.has(m.name)) continue; |
| 268 | shownMarketplaceNames.add(m.name); |
no test coverage detected