[gnome-ostree] Revert "builtin: Don't emit a useless stack trace when a builtin fails"



commit 4d273becddfe89fc38e344fef2b4ff4d864da591
Author: Colin Walters <walters verbum org>
Date:   Thu Sep 5 17:58:37 2013 -0400

    Revert "builtin: Don't emit a useless stack trace when a builtin fails"
    
    This reverts commit 175cdae72e75bc5e64c9ef7c2f214746d6f54111.
    Unfortunately it causes all exceptions to be silently consumed...

 src/js/builtin.js |   14 ++------------
 src/js/main.js    |    9 +++++++--
 2 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/src/js/builtin.js b/src/js/builtin.js
index 8f51666..cc14040 100644
--- a/src/js/builtin.js
+++ b/src/js/builtin.js
@@ -71,17 +71,7 @@ const Builtin = new Lang.Class({
     },
 
     main: function(argv, loop, cancellable) {
-        let result;
-        try {
-           let args = this.parser.parse(argv);
-            result = this.execute(args, loop, cancellable);
-        } catch(e) {
-            log(e.message);
-            return 1;
-        }
-
-        if (result === undefined)
-            return 0;
-        return result;
+       let args = this.parser.parse(argv);
+       this.execute(args, loop, cancellable);
     }
 });
diff --git a/src/js/main.js b/src/js/main.js
index 212b989..e089d32 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -76,8 +76,13 @@ if (ARGV.length < 1) {
        let cancellable = null;
        GLib.idle_add(GLib.PRIORITY_DEFAULT,
                      function() {
-                         ecode = instance.main(argv, loop, cancellable);
-                          loop.quit();
+                         ecode = 1;
+                         try {
+                             instance.main(argv, loop, cancellable);
+                             ecode = 0;
+                         } finally {
+                             loop.quit();
+                         }
                          return false;
                      });
        loop.run();


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