summaryrefslogtreecommitdiff
path: root/src/edit/util.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-11-02 18:53:20 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-11-02 18:53:20 -0400
commit7d5f4e73158cfc4837e6fe1ccf609c931c4f87b7 (patch)
tree8af98da31237013c251b9de490c4d88aa5755195 /src/edit/util.go
parent1a7dd9bd692ff9db64cea670fa0feaa79c82706d (diff)
views
Diffstat (limited to 'src/edit/util.go')
-rw-r--r--src/edit/util.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/edit/util.go b/src/edit/util.go
index 519e46c..566796c 100644
--- a/src/edit/util.go
+++ b/src/edit/util.go
@@ -1,7 +1,25 @@
package main
+import (
+ "os/exec"
+)
+
+type exitError exec.ExitError
+
+func (e *exitError) Error() string {
+ ret := e.ProcessState.String()
+ if len(e.Stderr) > 0 {
+ ret += "\n" + string(e.Stderr)
+ }
+ return ret
+}
+
func errcheck(err error) {
if err != nil {
+ if ee, ok := err.(*exec.ExitError); ok {
+ ee2 := exitError(*ee)
+ err = &ee2
+ }
panic(err)
}
}