mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
fix:尝试修复了新手引导闪退的问题
This commit is contained in:
@@ -58,12 +58,24 @@ export class WcdbService {
|
||||
})
|
||||
|
||||
this.worker.on('error', (err) => {
|
||||
// Worker error
|
||||
// Worker 发生错误,需要 reject 所有 pending promises
|
||||
console.error('WCDB Worker 错误:', err)
|
||||
const errorMsg = err instanceof Error ? err.message : String(err)
|
||||
for (const [id, p] of this.pending) {
|
||||
p.reject(new Error(`Worker 错误: ${errorMsg}`))
|
||||
}
|
||||
this.pending.clear()
|
||||
})
|
||||
|
||||
this.worker.on('exit', (code) => {
|
||||
// Worker 退出,需要 reject 所有 pending promises
|
||||
if (code !== 0) {
|
||||
// Worker exited with error
|
||||
console.error('WCDB Worker 异常退出,退出码:', code)
|
||||
const errorMsg = `Worker 异常退出 (退出码: ${code})。可能是 DLL 加载失败,请检查是否安装了 Visual C++ Redistributable。`
|
||||
for (const [id, p] of this.pending) {
|
||||
p.reject(new Error(errorMsg))
|
||||
}
|
||||
this.pending.clear()
|
||||
}
|
||||
this.worker = null
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user