Implement Try for ExitStatus #54889
Labels
A-error-handling
Area: Error handling
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
PG-error-handling
Project group: Error handling (https://github.com/rust-lang/project-error-handling)
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
It would be useful if
std::process::ExitStatus
implementedstd::ops::Try
. This could reduce boilerplate code where multipleCommand
s need to be spawned and checked.Open question: What's a good error type?
ExitStatus
itself already contains all the relevant error information from the command, but being able to return a result ofErr(ExitStatus::from_code(0))
would be weird. (Thanks @scottmcm for pointing this out.)The text was updated successfully, but these errors were encountered: