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

Function formatBashError

src/utils/promptShellExecution.ts:167–183  ·  view source on GitHub ↗
(e: unknown, pattern: string, inline = false)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

formatBashOutputFunction · 0.85
errorMessageFunction · 0.70

Tested by

no test coverage detected