(executable: string, cmd: string, args: string[], err: Error)
| 512 | } |
| 513 | |
| 514 | function createSpawnError(executable: string, cmd: string, args: string[], err: Error): AppError { |
| 515 | const code = (err as NodeJS.ErrnoException).code; |
| 516 | if (code === 'ENOENT') { |
| 517 | return createMissingToolError(executable, cmd, err); |
| 518 | } |
| 519 | return createCommandFailedError(executable, cmd, args, err); |
| 520 | } |
| 521 | |
| 522 | function createMissingToolError(executable: string, cmd: string, cause: Error): AppError { |
| 523 | return new AppError('TOOL_MISSING', `${executable} not found in PATH`, { cmd }, cause); |
no test coverage detected