fix: some promise error Handlings

This commit is contained in:
Ramesh Mane
2026-01-17 10:29:17 +00:00
parent 581103cc21
commit fa95bc29c7
4 changed files with 41 additions and 26 deletions

View File

@@ -68,31 +68,34 @@ const onLog = (data: { message: string }) => {
const onStatus = async (status: JobStatus, data?: any) => {
lastProgress.value = { msg: data?.message, status }
try {
if (status === JobStatus.COMPLETED) {
showGoToDashboardButton.value = true
if (status === JobStatus.COMPLETED) {
showGoToDashboardButton.value = true
if (syncOptions.value.workspaceMode || syncOptions.value.newBase) {
await basesStore.loadProjects()
} else {
await baseStore.loadProject()
}
if (syncOptions.value.workspaceMode || syncOptions.value.newBase) {
await basesStore.loadProjects()
} else {
await baseStore.loadProject()
progressRef.value?.pushProgress('Done!', status)
refreshCommandPalette()
// TODO: add tab of the first table
} else if (status === JobStatus.FAILED) {
if (syncOptions.value.workspaceMode || syncOptions.value.newBase) {
await basesStore.loadProjects()
} else {
await baseStore.loadProject()
}
goBack.value = true
progressRef.value?.pushProgress(data?.error?.message, status)
lastProgress.value = { msg: data?.error?.message, status }
refreshCommandPalette()
}
progressRef.value?.pushProgress('Done!', status)
refreshCommandPalette()
// TODO: add tab of the first table
} else if (status === JobStatus.FAILED) {
if (syncOptions.value.workspaceMode || syncOptions.value.newBase) {
await basesStore.loadProjects()
} else {
await baseStore.loadProject()
}
goBack.value = true
progressRef.value?.pushProgress(data?.error?.message, status)
lastProgress.value = { msg: data?.error?.message, status }
refreshCommandPalette()
} catch (e: any) {
console.log('Error while loading project(s)', e)
}
}