mirror of
https://github.com/charmbracelet/gum
synced 2026-03-14 13:45:45 +01:00
fix: logic to handle interrupt before timeout in error checking (#918)
- Reorder conditions to check ErrInterrupted before ErrProgramKilled - Prevents Ctrl+C from being incorrectly treated as timeout
This commit is contained in:
parent
181be44694
commit
8081f74c4a
1 changed files with 3 additions and 3 deletions
6
main.go
6
main.go
|
|
@ -78,13 +78,13 @@ func main() {
|
|||
if errors.As(err, &ex) {
|
||||
os.Exit(int(ex))
|
||||
}
|
||||
if errors.Is(err, tea.ErrInterrupted) {
|
||||
os.Exit(exit.StatusAborted)
|
||||
}
|
||||
if errors.Is(err, tea.ErrProgramKilled) {
|
||||
fmt.Fprintln(os.Stderr, "timed out")
|
||||
os.Exit(exit.StatusTimeout)
|
||||
}
|
||||
if errors.Is(err, tea.ErrInterrupted) {
|
||||
os.Exit(exit.StatusAborted)
|
||||
}
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue