We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91fc55f commit f9d4997Copy full SHA for f9d4997
2 files changed
src/composables/useImporter.ts
@@ -30,6 +30,9 @@ export async function importFiles(
30
console.log(`文件 ${name} 使用适配器: ${adapter.name}`);
31
} catch (error) {
32
console.error(`解析文件 ${name} 失败:`, error);
33
+ throw new Error(
34
+ `文件 "${name}" 解析失败: ${error instanceof Error ? error.message : '未知错误'}`,
35
+ );
36
}
37
38
return documents;
src/io/import/importAdapters.ts
@@ -17,6 +17,10 @@ export function dispatchAdapter(text: string): ImportAdapter {
17
bestAdapter = adapter;
18
19
20
+ // 如果所有 adapter 得分都小于 10
21
+ if (maxScore < 10) {
22
+ throw new Error('无法识别该文件的格式,暂不支持导入。');
23
+ }
24
25
return bestAdapter;
26
0 commit comments