(deps: ProviderDeps, url: string)
| 397 | } |
| 398 | |
| 399 | async function loadCatalogOrExit(deps: ProviderDeps, url: string): Promise<Catalog> { |
| 400 | try { |
| 401 | return await fetchCatalog(url); |
| 402 | } catch (error) { |
| 403 | const suffix = error instanceof CatalogFetchError ? ` (HTTP ${String(error.status)})` : ''; |
| 404 | deps.stderr.write(`Failed to fetch catalog from ${url}${suffix}: ${errorMessage(error)}\n`); |
| 405 | deps.exit(1); |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | export function registerProviderCommand(parent: Command, deps?: Partial<ProviderDeps>): void { |
| 410 | const provider = parent |
no test coverage detected