MCPcopy
hub / github.com/coder/mux / interpretCoderResult

Function interpretCoderResult

src/node/services/coderService.ts:270–286  ·  view source on GitHub ↗
(result: CoderCommandResult)

Source from the content-addressed store, hash-verified

268 | { ok: false; error: string; combined: string };
269
270function interpretCoderResult(result: CoderCommandResult): InterpretedCoderCommandResult {
271 const combined = `${result.stderr}\n${result.stdout}`.trim();
272
273 if (result.error) {
274 return { ok: false, error: result.error, combined };
275 }
276
277 if (result.exitCode !== 0) {
278 return {
279 ok: false,
280 error: combined || `Exit code ${String(result.exitCode)}`,
281 combined,
282 };
283 }
284
285 return { ok: true, stdout: result.stdout, stderr: result.stderr };
286}
287
288function sanitizeCoderCliErrorForUi(error: unknown): string {
289 if (!(error instanceof Error)) {

Callers 4

getWorkspaceStatusMethod · 0.85
startWorkspaceMethod · 0.85
stopWorkspaceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected