From b3c6c4a9ffe87b1c50ed001e15bc7f44796015e0 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 24 Jul 2024 15:16:44 -0400 Subject: [PATCH] fix: catch huh timeout error Huh returns a `ErrTimeout` on timeout error and we need to catch that. Fixes: https://github.com/charmbracelet/gum/pull/618 --- choose/command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/choose/command.go b/choose/command.go index 2c88e4c77..585ea61f3 100644 --- a/choose/command.go +++ b/choose/command.go @@ -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 { @@ -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 }