clap_complete: generate()
shouldn't panic if writing fails
#5457
Labels
C-bug
Category: Updating dependencies
M-breaking-change
Meta: Implementing or merging this will introduce a breaking change.
Please complete the following tasks
I have searched the discussions
I have searched the existing issues
Rust Version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
Clap Version
master
Actual Behaviour
Running generate() can panic, for example if writing to a pipe ans the next program stops, or anything really stops the generation from completing.
For example
with a long enough completion will panic.
Expected Behaviour
generate() should return a Result indicating if it fails. This will be a breaking change.
Additional Context
Maybe we ignore some errors? I'm not sure what consumers will want to do with the error, and some of them might be not important enough to propagate, for example a broken pipe.
The panic happens here:
clap/clap_complete/src/macros.rs
Line 5 in 0cd10d1
Opened after suggestion in #5453.
The text was updated successfully, but these errors were encountered: