Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/exec: include stderr in ExitError #11381

Closed
bradfitz opened this issue Jun 24, 2015 · 2 comments
Closed

os/exec: include stderr in ExitError #11381

bradfitz opened this issue Jun 24, 2015 · 2 comments
Milestone

Comments

@bradfitz
Copy link
Contributor

We should include Stderr in ExitError, so you can write code like:

stdout, err := exec.Command("foo", "fail").Output()
if err != nil {
     log.Fatalf("foo command failed: %v: %s", err, err.(*exec.ExitError).Stderr)
}

Sketch without tests at:
https://go-review.googlesource.com/11415

/cc @rsc

@bradfitz bradfitz self-assigned this Jun 24, 2015
@bradfitz bradfitz added this to the Go1.6 milestone Jun 24, 2015
@josharian
Copy link
Contributor

Nice.

@rsc
Copy link
Contributor

rsc commented Nov 5, 2015

CL 11415 did this.

@rsc rsc closed this as completed Nov 5, 2015
@golang golang locked and limited conversation to collaborators Nov 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants