Skip to content

Commit

Permalink
fix: catch huh timeout error
Browse files Browse the repository at this point in the history
Huh returns a `ErrTimeout` on timeout error and we need to catch that.

Fixes: #618
  • Loading branch information
aymanbagabas committed Jul 24, 2024
1 parent d20ce80 commit b3c6c4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions choose/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (o Options) Run() error {
WithTheme(theme).
WithTimeout(o.Timeout).
Run()
if err != nil {
if err != nil && !errors.Is(err, huh.ErrTimeout) {
return err
}
if len(choices) > 0 {
Expand All @@ -114,7 +114,7 @@ func (o Options) Run() error {
WithShowHelp(o.ShowHelp).
WithTimeout(o.Timeout).
Run()
if err != nil {
if err != nil && !errors.Is(err, huh.ErrTimeout) {
return err
}

Expand Down

0 comments on commit b3c6c4a

Please sign in to comment.