handle config errors gracefully
This commit is contained in:
parent
92604b391b
commit
340966195b
1 changed files with 45 additions and 25 deletions
|
|
@ -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()
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue