fix(web): 大纲错误透传 FriendlyError, 不再向用户暴露内部 code
This commit is contained in:
@@ -8,6 +8,7 @@ import { Button } from "@/components/ui/Button";
|
||||
import { EmptyState } from "@/components/ui/EmptyState";
|
||||
import { PageHeader } from "@/components/ui/PageHeader";
|
||||
import { Select } from "@/components/ui/Select";
|
||||
import { StatusNote } from "@/components/ui/StatusNote";
|
||||
import { TextInput } from "@/components/ui/TextInput";
|
||||
import type { OutlineChapterView, ProjectResponse } from "@/lib/api/types";
|
||||
import {
|
||||
@@ -111,20 +112,20 @@ export function OutlineEditor({
|
||||
/>
|
||||
|
||||
{error ? (
|
||||
<p className="mb-4 text-sm text-conflict">
|
||||
大纲生成失败({error.code}):{error.message}
|
||||
{error.code === "LLM_UNAVAILABLE" ? (
|
||||
<StatusNote variant="danger" title="大纲生成失败" className="mb-4">
|
||||
{error.text}
|
||||
{error.actionHref ? (
|
||||
<>
|
||||
{" "}
|
||||
<a
|
||||
href="/settings/providers"
|
||||
href={error.actionHref}
|
||||
className="underline hover:text-cinnabar"
|
||||
>
|
||||
去设置提供商
|
||||
{error.actionLabel}
|
||||
</a>
|
||||
</>
|
||||
) : null}
|
||||
</p>
|
||||
</StatusNote>
|
||||
) : null}
|
||||
|
||||
<div className="min-h-0 flex-1 overflow-auto">
|
||||
|
||||
Reference in New Issue
Block a user