feat(ai): improve error handling

This commit is contained in:
AnotiaWang
2025-02-24 20:06:04 +08:00
parent 9f85c04490
commit f077807128
3 changed files with 31 additions and 5 deletions

View File

@ -126,7 +126,7 @@ export function generateSearchQueries({
system: systemPrompt(),
prompt,
onError({ error }) {
throw error
throwAiError('generateSearchQueries', error)
},
})
}
@ -174,7 +174,7 @@ function processSearchResult({
system: systemPrompt(),
prompt,
onError({ error }) {
throw error
throwAiError('processSearchResult', error)
},
})
}
@ -204,7 +204,7 @@ export function writeFinalReport({
system: systemPrompt(),
prompt: _prompt,
onError({ error }) {
throw error
throwAiError('writeFinalReport', error)
},
})
}