Improve tag creation error handling

This commit is contained in:
Tim
2025-07-10 11:35:36 +08:00
parent fe6eac5775
commit 98485cc7af

View File

@@ -138,6 +138,13 @@ export default {
selectedTags.value[i] = data.id
// update local TagSelect options handled by component
} else {
let data
try {
data = await res.json()
} catch (e) {
data = null
}
toast.error((data && data.error) || '创建标签失败')
throw new Error('create tag failed')
}
}