]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: Add global ajaxError handler
authorMichael Wood <michael.g.wood@intel.com>
Thu, 21 May 2015 17:45:44 +0000 (18:45 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Jun 2015 23:01:50 +0000 (00:01 +0100)
If any ajax calls fail and debug is enabled log the error to the console.

(Bitbake rev: 978ab17033ec48ee0a82016b7e4d6a2fe5d21dbb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/toaster/toastergui/static/js/libtoaster.js
bitbake/lib/toaster/toastergui/static/js/table.js

index c3798336f2b3042b0ce46a0a08569166b1b1bd9a..667aca20ff4d6ef7fc17c8dc8e399f3e3b6a8f1c 100644 (file)
@@ -503,6 +503,11 @@ $(document).ready(function() {
       $("#loading-notification").fadeOut();
     });
 
+    $(document).ajaxError(function(event, jqxhr, settings, errMsg){
+      console.warn("Problem with xhr call");
+      console.warn(errMsg);
+      console.warn(jqxhr.responseText);
+    });
 
     function check_for_duplicate_ids () {
       /* warn about duplicate element ids */
index 45c61848da25d9810631354355ba47bf20d3c475..1072c7588db4767702ecf4e00bd520d36f11da65 100644 (file)
@@ -53,11 +53,6 @@ function tableInit(ctx){
               tableData: tableData,
               tableParams: tableParams
           }, null, libtoaster.dumpsUrlParams(tableParams));
-        },
-
-        error: function (_data) {
-          console.warn("Call failed");
-          console.warn(_data);
         }
     });
   }