Skip to content

Commit e292bbf

Browse files
authored
fix: detect timeout error and apply default option (#888)
1 parent e43b277 commit e292bbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

confirm/command.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package confirm
22

33
import (
4+
"context"
45
"fmt"
56
"os"
67

@@ -46,7 +47,7 @@ func (o Options) Run() error {
4647
tea.WithOutput(os.Stderr),
4748
tea.WithContext(ctx),
4849
).Run()
49-
if err != nil {
50+
if err != nil && ctx.Err() != context.DeadlineExceeded {
5051
return fmt.Errorf("unable to confirm: %w", err)
5152
}
5253
m = tm.(model)

0 commit comments

Comments
 (0)