summaryrefslogtreecommitdiff
path: root/src/edit/util.go
diff options
context:
space:
mode:
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)
}
}