diff --git a/packages/nc-gui-v2/components/dlg/QuickImport.vue b/packages/nc-gui-v2/components/dlg/QuickImport.vue index 24ada584da..a1348c2da3 100644 --- a/packages/nc-gui-v2/components/dlg/QuickImport.vue +++ b/packages/nc-gui-v2/components/dlg/QuickImport.vue @@ -141,9 +141,14 @@ async function handlePreImport() { } async function handleImport() { - loading.value = true - await templateEditorRef.value.importTemplate() - loading.value = false + try { + loading.value = true + await templateEditorRef.value.importTemplate() + } catch (e: any) { + return toast.error(await extractSdkResponseErrorMsg(e)) + } finally { + loading.value = false + } dialogShow.value = false } diff --git a/packages/nc-gui-v2/components/template/Editor.vue b/packages/nc-gui-v2/components/template/Editor.vue index b87e24b1f6..caf1d4ae6f 100644 --- a/packages/nc-gui-v2/components/template/Editor.vue +++ b/packages/nc-gui-v2/components/template/Editor.vue @@ -174,9 +174,8 @@ async function importTemplate() { try { await validate() } catch (errorInfo) { - toast.error('Please fill all the required values') isImporting.value = false - return + throw new Error('Please fill all the required values') } try { @@ -477,4 +476,4 @@ defineExpose({ @apply !pb-0; } } - \ No newline at end of file +