Skip to content
Myr

fix: catch huh timeout error (#632)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Huh returns a `ErrTimeout` on timeout error and we need to catch that.

authored by Ayman Bagabas · committed by GitHub · parent 19e79b1 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Fixes: https://github.com/charmbracelet/gum/pull/618

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:choose/command.go+2 added-2 removed
75 unmodified lines
76 WithWidth(width).77 WithShowHelp(o.ShowHelp).78 WithTheme(theme).79 Run()80 if err != nil {80 if err != nil && !errors.Is(err, huh.ErrTimeout) {81 return err82 }83 if len(choices) > 0 {84 s := strings.Join(choices, "\n")
16 unmodified lines
101 WithWidth(width).102 WithTheme(theme).103 WithShowHelp(o.ShowHelp).104 Run()105 if err != nil {105 if err != nil && !errors.Is(err, huh.ErrTimeout) {106 return err107 }108109 if term.IsTerminal(os.Stdout.Fd()) {
26 unmodified lines