接口报错异常处理
This commit is contained in:
1 parent
73e76fc72f
commit
2c56a84bb7
4 files changed
+65
-9
No files matched your search
@@ -77,6 +77,17 @@ export function TimelineStep({ event, isLast, children }: TimelineStepProps) {
|
||||
{event.detail}
|
||||
</p>
|
||||
)}
|
||||
{/* 接口解析失败时的原始错误响应体,默认折叠,点击展开 */}
|
||||
{event.raw && (
|
||||
<details className="mt-1">
|
||||
<summary className="cursor-pointer select-none text-[11px] font-medium text-muted-foreground hover:text-foreground">
|
||||
错误返回结果(点击展开)
|
||||
</summary>
|
||||
<pre className="mt-1 max-h-60 overflow-auto whitespace-pre-wrap break-all rounded bg-muted/60 p-2 text-[10px] leading-relaxed text-muted-foreground">
|
||||
{event.raw}
|
||||
</pre>
|
||||
</details>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<span className="ml-1.5 text-xs text-muted-foreground">{event.message}</span>
|
||||
|
||||
@@ -90,6 +90,8 @@ export interface ProgressEvent {
|
||||
// notice(非致命告警)/ error:标题 + 真实原因
|
||||
title?: string;
|
||||
detail?: string;
|
||||
// 接口解析失败时的原始错误响应体,前端默认折叠展示
|
||||
raw?: string;
|
||||
// materials_ready
|
||||
materials?: AIMaterial[];
|
||||
keywords?: string[];
|
||||
|
||||
Reference in new issue
Block a user