Closed
Description
Describe the bug
I should be able to use errors.Is
to check the error returned by the context after p.Run
. But that's broken.
Setup
Please complete the following information along with version numbers, if applicable.
- OS Any
- Shell Any
- Terminal Emulator Any
- Terminal Multiplexer Any
To Reproduce
Steps to reproduce the behavior:
See source code
Source Code
ctx := context.WithDeadline(context.Background, time.Second*5)
p := tea.NewProgram(model, tea.WithContext(ctx))
_, err := p.Run()
if errors.Is(err, context.DeadlineExceeded) {
// Handle timeout
}
Expected behavior
If the five seconds pass during run (in this example), that if block should be executed.
Additional context
Line 598 in 9f015c5
On L598, change the format to "%w: %w"
, and that should work.
Metadata
Metadata
Assignees
Labels
No labels