handle config errors gracefully

This commit is contained in:
Dax Raad
2025-11-13 18:59:09 -05:00
parent 92604b391b
commit 340966195b
4 changed files with 45 additions and 25 deletions

View File

@@ -53,10 +53,14 @@ export const Instance = {
await State.dispose(Instance.directory)
},
async disposeAll() {
Log.Default.info("disposing all instances")
for (const [_key, value] of cache) {
await context.provide(await value, async () => {
await Instance.dispose()
})
const awaited = await value.catch(() => {})
if (awaited) {
await context.provide(await value, async () => {
await Instance.dispose()
})
}
}
cache.clear()
},