Changed NewBranch.bjsNewBranch.vala
[gitlive] / Spawn.vala
index b033deb..1ff51e8 100644 (file)
@@ -242,6 +242,20 @@ public class Spawn : Object
                                                        out ls_stderr,
                                                        out ls_status
                        );
+                       this.output = ls_stdout;
+                       this.stderr = ls_stderr;
+                       this.result = ls_status;
+                       if (this.cfg.exceptions && this.result != 0) {
+                               var errstr = string.joinv(" ", this.cfg.args) + "\n";
+                               errstr += this.output;
+                               errstr += this.output.length > 0 ? "\n" : "";
+                               errstr += this.stderr;
+                               //print("Throwing execute error:%s\n", errstr);
+                       throw   new SpawnError.EXECUTE_ERROR(errstr);
+                       //this.toString = function() { return this.stderr; };
+                       ///throw new Exception this; // we throw self...
+                   }
+                   return;
                        
                }