fix: improve error message when exporting long conversations as image

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
xintaofei
2026-04-03 23:38:25 +08:00
parent 40d0a4b995
commit 32a1c5adc0
12 changed files with 33 additions and 6 deletions

View File

@@ -71,6 +71,7 @@ import {
exportAsHtml,
exportAsImage,
exportAsMarkdown,
ExportTooLongError,
type ExportLabels,
} from "@/lib/export-conversation"
@@ -1275,7 +1276,11 @@ export function ConversationDetailPanel() {
toast.success(t("exportSuccess"))
} catch (err) {
updateTask(taskId, { status: "failed" })
toast.error(t("exportFailed"))
if (err instanceof ExportTooLongError) {
toast.error(t("exportImageTooLong"))
} else {
toast.error(t("exportFailed"))
}
console.error("[ConversationDetailPanel] export image:", err)
}
}, [getExportData, t, addTask, updateTask])