* Format exit status from ExitCodeDetails
(exitDetails: ExitCodeDetails | undefined)
| 567 | * Format exit status from ExitCodeDetails |
| 568 | */ |
| 569 | function formatExitStatus(exitDetails: ExitCodeDetails | undefined): string { |
| 570 | if (exitDetails === undefined) { |
| 571 | return "Exit code: <undefined, notify user>" |
| 572 | } |
| 573 | |
| 574 | if (exitDetails.signalName) { |
| 575 | let status = `Process terminated by signal ${exitDetails.signalName}` |
| 576 | if (exitDetails.coreDumpPossible) { |
| 577 | status += " - core dump possible" |
| 578 | } |
| 579 | return status |
| 580 | } |
| 581 | |
| 582 | if (exitDetails.exitCode === undefined) { |
| 583 | return "Exit code: <undefined, notify user>" |
| 584 | } |
| 585 | |
| 586 | let status = "" |
| 587 | if (exitDetails.exitCode !== 0) { |
| 588 | status += "Command execution was not successful, inspect the cause and adjust as needed.\n" |
| 589 | } |
| 590 | status += `Exit code: ${exitDetails.exitCode}` |
| 591 | return status |
| 592 | } |
| 593 | |
| 594 | /** |
| 595 | * Format persisted output result for tool response when output was truncated |
no outgoing calls
no test coverage detected