fix duplicated catch error (#194)

This commit is contained in:
an-lee
2024-01-23 16:10:51 +08:00
committed by GitHub
parent 51a71df326
commit 506ea39ccb

View File

@@ -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