[web/data] Never hide JS errors in our Deferred implementation
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 28 Jan 2015 11:53:20 +0100
changeset 10165 7f1f7f710b16
parent 10164 2094262d6553
child 10166 0095961df66c
[web/data] Never hide JS errors in our Deferred implementation Modern browsers have good debugging tools, let exceptions go all the way up. This only affects exceptions raised in the js code, if there's an issue on the server/python side, they'll keep going through our error callbacks. Closes #4881300
web/data/cubicweb.ajax.js
--- a/web/data/cubicweb.ajax.js	Wed Jan 28 11:51:16 2015 +0100
+++ b/web/data/cubicweb.ajax.js	Wed Jan 28 11:53:20 2015 +0100
@@ -62,15 +62,11 @@
 
     success: function(result) {
         this._result = result;
-        try {
-            for (var i = 0; i < this._onSuccess.length; i++) {
-                var callback = this._onSuccess[i][0];
-                var args = [result, this._req];
-                jQuery.merge(args, this._onSuccess[i][1]);
-                callback.apply(null, args);
-            }
-        } catch(error) {
-            this.error(this._req, null, error);
+        for (var i = 0; i < this._onSuccess.length; i++) {
+            var callback = this._onSuccess[i][0];
+            var args = [result, this._req];
+            jQuery.merge(args, this._onSuccess[i][1]);
+            callback.apply(null, args);
         }
     },