-
Notifications
You must be signed in to change notification settings - Fork 330
Closed
Description
$ volta --version
Updating your Volta directory. This may take a few moments...
1.0.5
$ RUST_BACKTRACE=1 volta -h | false
thread 'main' panicked at 'Error writing Error to stdout: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', /Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/clap-2.33.0/src/errors.rs:401:55
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: core::result::Result<T,E>::expect
4: clap::errors::Error::exit
5: clap::app::App::get_matches_from::{{closure}}
6: clap::app::App::get_matches
7: volta::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.Clap provides a get_matches_from_safe API that returns a Result rather than panicking when failing to write to stdout.
Here's some MIT-licensed code I use in one of my projects that does this dance in a panic-free way:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels