MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getErrorParts

Function getErrorParts

src/utils/toolErrors.ts:24–41  ·  view source on GitHub ↗
(error: Error)

Source from the content-addressed store, hash-verified

22}
23
24export function getErrorParts(error: Error): string[] {
25 if (error instanceof ShellError) {
26 return [
27 `Exit code ${error.code}`,
28 error.interrupted ? INTERRUPT_MESSAGE_FOR_TOOL_USE : '',
29 error.stderr,
30 error.stdout,
31 ]
32 }
33 const parts = [error.message]
34 if ('stderr' in error && typeof error.stderr === 'string') {
35 parts.push(error.stderr)
36 }
37 if ('stdout' in error && typeof error.stdout === 'string') {
38 parts.push(error.stdout)
39 }
40 return parts
41}
42
43/**
44 * Formats a Zod validation path into a readable string

Callers 2

formatErrorFunction · 0.85
startMCPServerFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected