Skip to content

Implement Try for ExitStatus #54889

Closed
Closed
@fenhl

Description

@fenhl

It would be useful if std::process::ExitStatus implemented std::ops::Try. This could reduce boilerplate code where multiple Commands 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 of Err(ExitStatus::from_code(0)) would be weird. (Thanks @scottmcm for pointing this out.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-error-handlingArea: Error handlingC-feature-requestCategory: A feature request, i.e: not implemented / a PR.PG-error-handlingProject group: Error handling (https://github.com/rust-lang/project-error-handling)T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions