From 4f459fca798d8338e6a84fdd5ce73a9d395a67e8 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 21 May 2015 18:45:44 +0100 Subject: bitbake: toaster: Add global ajaxError handler If any ajax calls fail and debug is enabled log the error to the console. (Bitbake rev: 978ab17033ec48ee0a82016b7e4d6a2fe5d21dbb) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 5 +++++ bitbake/lib/toaster/toastergui/static/js/table.js | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'bitbake/lib/toaster') diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index c3798336f2..667aca20ff 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js @@ -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 */ diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index 45c61848da..1072c7588d 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -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); } }); } -- cgit v1.2.3-54-g00ecf