(options: Options)
| 486 | } |
| 487 | |
| 488 | const toStartError = (options: Options) => (error: NodeJS.ErrnoException): PlatformError.PlatformError => { |
| 489 | const executable = options.executable ?? globalThis.process.execPath |
| 490 | const timedOut = error.code === "ETIMEDOUT" |
| 491 | if (!timedOut && error.syscall !== undefined) { |
| 492 | return handleErrnoException("ChildProcess", "layerProxyProcess")(error, [executable]) |
| 493 | } |
| 494 | return PlatformError.systemError({ |
| 495 | _tag: timedOut ? "TimedOut" : "Unknown", |
| 496 | module: "ChildProcess", |
| 497 | method: "layerProxyProcess", |
| 498 | description: error.message, |
| 499 | pathOrDescriptor: executable, |
| 500 | cause: error |
| 501 | }) |
| 502 | } |
| 503 | |
| 504 | /** |
| 505 | * Starts a proxy process. Another one is started on demand after it exits, or |
no test coverage detected