(fn: () => Promise<T>)
| 128 | } |
| 129 | |
| 130 | async function tryRun<T>(fn: () => Promise<T>): Promise<T | undefined> { |
| 131 | try { |
| 132 | return await fn(); |
| 133 | } catch (error) { |
| 134 | if (error instanceof ExitCalled) return undefined; |
| 135 | throw error; |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | const REGISTRY_URL = 'https://registry.example.test/v1/models/api.json'; |
| 140 | const REGISTRY_BODY = { |