MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getErrorMessage

Function getErrorMessage

source code/utils/execFileNoThrow.ts:75–86  ·  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

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

Callers 1

execFileNoThrowWithCwdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected