MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / handleError

Function handleError

src/core/assistant-message/presentAssistantMessage.ts:222–234  ·  view source on GitHub ↗
(action: string, error: Error)

Source from the content-addressed store, hash-verified

220 }
221
222 const handleError = async (action: string, error: Error) => {
223 // Silently ignore AskIgnoredError - this is an internal control flow
224 // signal, not an actual error. It occurs when a newer ask supersedes an older one.
225 if (error instanceof AskIgnoredError) {
226 return
227 }
228 const errorString = `Error ${action}: ${JSON.stringify(serializeError(error))}`
229 await cline.say(
230 "error",
231 `Error ${action}:\n${error.message ?? JSON.stringify(serializeError(error), null, 2)}`,
232 )
233 pushToolResult(formatResponse.toolError(errorString))
234 }
235
236 if (!mcpBlock.partial) {
237 cline.recordToolUsage("use_mcp_tool") // Record as use_mcp_tool for analytics

Callers 15

executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85

Calls 2

pushToolResultFunction · 0.85
sayMethod · 0.80

Tested by

no test coverage detected