MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / getErrorMessage

Function getErrorMessage

src/utils/execFileNoThrow.ts:73–84  ·  view source on GitHub ↗

* Extracts a human-readable error message from an execa result. * * Priority order: * 1. shortMessage - execa's human-readable error (e.g., "Command failed with exit code 1: ...") * This is preferred because it already includes signal info when a process is killed, * making it more inform

(
  result: ExecaResultWithError,
  errorCode: number,
)

Source from the content-addressed store, hash-verified

71 * 3. errorCode - fallback to just the numeric exit code
72 */
73function getErrorMessage(
74 result: ExecaResultWithError,
75 errorCode: number,
76): string {
77 if (result.shortMessage) {
78 return result.shortMessage
79 }
80 if (typeof result.signal === 'string') {
81 return result.signal
82 }
83 return String(errorCode)
84}
85
86/**
87 * execFile, but always resolves (never throws)

Callers 1

execFileNoThrowWithCwdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected