Skip to content

Implement Try for ExitStatus #54889

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions