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