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

Function formatBashError

source code/utils/promptShellExecution.ts:169–185  ·  view source on GitHub ↗
(e: unknown, pattern: string, inline = false)

Source from the content-addressed store, hash-verified

167}
168
169function formatBashError(e: unknown, pattern: string, inline = false): never {
170 if (e instanceof ShellError) {
171 if (e.interrupted) {
172 throw new MalformedCommandError(
173 `Shell command interrupted for pattern "${pattern}": [Command interrupted]`,
174 )
175 }
176 const output = formatBashOutput(e.stdout, e.stderr, inline)
177 throw new MalformedCommandError(
178 `Shell command failed for pattern "${pattern}": ${output}`,
179 )
180 }
181
182 const message = errorMessage(e)
183 const formatted = inline ? `[Error: ${message}]` : `[Error]\n${message}`
184 throw new MalformedCommandError(formatted)
185}

Callers 1

Calls 2

formatBashOutputFunction · 0.85
errorMessageFunction · 0.70

Tested by

no test coverage detected