fix duplicated catch error (#194)
This commit is contained in:
@@ -79,22 +79,14 @@ export default () => {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await extractStoryCommand(story.content, {
|
||||
key: openai.key,
|
||||
modelName: openai.model,
|
||||
baseUrl: openai.baseUrl,
|
||||
});
|
||||
const res = await extractStoryCommand(story.content, {
|
||||
key: openai.key,
|
||||
modelName: openai.model,
|
||||
baseUrl: openai.baseUrl,
|
||||
});
|
||||
|
||||
words = res.words || [];
|
||||
idioms = res.idioms || [];
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
toast.error(t("extractionFailed"), {
|
||||
description: error.message,
|
||||
});
|
||||
return;
|
||||
}
|
||||
words = res.words || [];
|
||||
idioms = res.idioms || [];
|
||||
}
|
||||
|
||||
webApi
|
||||
|
||||
Reference in New Issue
Block a user