MCPcopy
hub / github.com/callstack/agent-device / commandCloseFailure

Function commandCloseFailure

src/utils/exec.ts:612–627  ·  view source on GitHub ↗
(
  abort: CommandAbort,
  executable: string,
  cmd: string,
  args: string[],
  exitCode: number,
  allowFailure: boolean | undefined,
  stdout: string,
  stderr: string,
)

Source from the content-addressed store, hash-verified

610// Failure (if any) for a spawned child's `close` event: canceled if we aborted, an exit error on
611// a non-zero code unless allowed, otherwise null (the command resolves successfully).
612function commandCloseFailure(
613 abort: CommandAbort,
614 executable: string,
615 cmd: string,
616 args: string[],
617 exitCode: number,
618 allowFailure: boolean | undefined,
619 stdout: string,
620 stderr: string,
621): AppError | null {
622 if (abort.didAbort) return createCommandCanceledError(executable, cmd, args);
623 if (exitCode !== 0 && !allowFailure) {
624 return createExitError(executable, cmd, args, exitCode, stdout, stderr);
625 }
626 return null;
627}
628
629function normalizeOverridePath(
630 rawPath: string | undefined,

Callers 2

runSpawnedCommandFunction · 0.85
runCmdBackgroundFunction · 0.85

Calls 2

createExitErrorFunction · 0.85

Tested by

no test coverage detected