File tree Expand file tree Collapse file tree
packages/plugins/robot/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ import McpServer from './mcp/McpServer.vue'
104104import useMcpServer from ' ./mcp/useMcp'
105105import MarkdownRenderer from ' ./mcp/MarkdownRenderer.vue'
106106import LoadingRenderer from ' ./mcp/LoadingRenderer.vue'
107- import { sendMcpRequest } from ' ./mcp/utils'
107+ import { sendMcpRequest , serializeError } from ' ./mcp/utils'
108108import type { RobotMessage } from ' ./mcp/types'
109109
110110export default {
@@ -242,10 +242,10 @@ export default {
242242 }
243243 renderContent .push ({
244244 type: ' text' ,
245- content: ' 连接失败, 请稍后重试'
245+ content: ` 连接失败, 请稍后重试: ${ serializeError ( error )} `
246246 })
247247 } else {
248- messages .value .at (- 1 )! .content = ' 连接失败, 请稍后重试'
248+ messages .value .at (- 1 )! .content = ` 连接失败, 请稍后重试: ${ serializeError ( error )} `
249249 }
250250 } finally {
251251 inProcesing .value = false
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const parseArgs = (args: string) => {
3939 }
4040}
4141
42- const serializeError = ( err : unknown ) : string => {
42+ export const serializeError = ( err : unknown ) : string => {
4343 if ( err instanceof Error ) {
4444 return JSON . stringify ( { name : err . name , message : err . message } )
4545 }
You can’t perform that action at this time.
0 commit comments