[gnome-ostree] build: Correctly return exit code 1 if we throw an exception



commit f96c1c607f89972871a5817f04e9da7b91878c1c
Author: Colin Walters <walters verbum org>
Date:   Sun Jan 27 11:35:09 2013 -0500

    build: Correctly return exit code 1 if we throw an exception
    
    This should fix the autobuilder web UI showing success when
    we actually mean failure.

 src/ostbuild/js/main.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/ostbuild/js/main.js b/src/ostbuild/js/main.js
index 2efc192..d4a8fcd 100755
--- a/src/ostbuild/js/main.js
+++ b/src/ostbuild/js/main.js
@@ -74,15 +74,16 @@ if (ARGV.length < 1) {
 	let argv = ARGV.concat();
 	argv.shift();
 
-	let ecode = 1;
 	let loop = GLib.MainLoop.new(null, true);
 	let cls = getClass(name);
 	let instance = new cls;
 	let cancellable = null;
 	GLib.idle_add(GLib.PRIORITY_DEFAULT,
 		      function() {
+			  ecode = 1;
 			  try {
-			      instance.main(argv, loop, cancellable); ecode = 0;
+			      instance.main(argv, loop, cancellable);
+			      ecode = 0;
 			  } finally {
 			      loop.quit();
 			  }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]