[TOW-1331] Expose exit code on crash for local app run#153
Conversation
|
This PR is targeting If this is a regular feature/fix PR, please change the base branch to Current base: |
There was a problem hiding this comment.
Pull request overview
This PR exposes the exit code when a local application run crashes, improving error reporting by displaying the specific exit code to users instead of a generic crash message.
Key Changes:
- Modified crash error message to include the exit code
- Added debug logging for status task completion
- Cleaned up Status enum usage by removing redundant
tower_runtime::prefix
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Status::Crashed { .. } => { | ||
| output::error("Your local run crashed!"); | ||
| Status::Crashed { code } => { | ||
| output::error(&format!("Your local run crashed with exit code: {}", code)); |
There was a problem hiding this comment.
The error message doesn't clarify what the exit code number means or provide guidance on next steps. Consider adding context like 'Oh no! Your local run crashed with exit code: {}' to match the description, or provide guidance on interpreting common exit codes.
| output::error(&format!("Your local run crashed with exit code: {}", code)); | |
| let explanation = match code { | |
| // 130: terminated by Ctrl+C / SIGINT in many environments | |
| 130 => " (the run was interrupted, often by Ctrl+C or SIGINT)", | |
| // 137: often indicates the process was killed due to out-of-memory (SIGKILL) | |
| 137 => " (this often means the process was killed, for example due to out-of-memory)", | |
| _ => " (check your app logs for details, or consult documentation for this exit code)", | |
| }; | |
| output::error(&format!( | |
| "Oh no! Your local run crashed with exit code: {}{}", | |
| code, explanation | |
| )); |
Now prints something like