[gjs] Gio: Don't eat errors when calling reply functions



commit f8878e6c92c4bbbdb35f747e192dfec65794d04c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jan 2 09:48:36 2013 -0500

    Gio: Don't eat errors when calling reply functions
    
    If somebody errors out during a DBus reply callback, we should
    let them know about it, rather than keep them guessing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691016

 modules/overrides/Gio.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/modules/overrides/Gio.js b/modules/overrides/Gio.js
index 679be6f..8f543ef 100644
--- a/modules/overrides/Gio.js
+++ b/modules/overrides/Gio.js
@@ -79,12 +79,16 @@ function _proxyInvoker(methodName, sync, inSignature, arg_array) {
     var inVariant = new GLib.Variant('(' + inSignature.join('') + ')', arg_array);
 
     var asyncCallback = function (proxy, result) {
+        var outVariant = null, succeeded = false;
         try {
-            var outVariant = proxy.call_finish(result);
-            replyFunc(outVariant.deep_unpack(), null);
+            outVariant = proxy.call_finish(result);
+            succeeded = true;
         } catch (e) {
             replyFunc(null, e);
         }
+
+        if (succeeded)
+            replyFunc(outVariant.deep_unpack(), null);
     };
 
     if (sync) {



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