( currentPath: string, helperPath: string, child: ChildProcess, )
| 313 | } |
| 314 | |
| 315 | function renameHelperLogPathOrThrow( |
| 316 | currentPath: string, |
| 317 | helperPath: string, |
| 318 | child: ChildProcess, |
| 319 | ): string { |
| 320 | try { |
| 321 | fs.renameSync(currentPath, helperPath); |
| 322 | return helperPath; |
| 323 | } catch (error) { |
| 324 | stopDetachedHelper(child); |
| 325 | const message = toErrorMessage(error); |
| 326 | throw new Error(`Failed to move log file to helper-pid protected path: ${message}`); |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | function readLogFileSafe(filePath: string): string { |
| 331 | try { |
no test coverage detected