fix: 添加错误处理以优化数据库初始化操作
This commit is contained in:
parent
329833c228
commit
deafc59c77
@ -136,13 +136,17 @@ export async function InitializeTheCentralTable(params: InitializeTheCentralTabl
|
||||
}
|
||||
const folderPath = await fileUtil.initFolder(`/config/tableList`);
|
||||
fileUtil.addFile(`${folderPath}/${RemappingTableName[key]}.txt`, JSON.stringify(arrList))
|
||||
const result = await SqlInsertTable(RemappingTableName[key], arrList)
|
||||
if (!result) {
|
||||
Prompt.showToast({
|
||||
message: '初始化数据库失败'
|
||||
})
|
||||
try {
|
||||
const result = await SqlInsertTable(RemappingTableName[key], arrList)
|
||||
if (!result) {
|
||||
Prompt.showToast({
|
||||
message: '初始化数据库失败'
|
||||
})
|
||||
}
|
||||
resolve(result)
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
resolve(result)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user