From d5fc4f7f131c21768c6f9bc004715e76dc6fbe2a Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Wed, 26 Nov 2014 15:05:07 +0000 Subject: bitbake: toaster: libtoaster Add a error handler to GET in makeTypehead If the JSON data comes back from the request with an error set, have a default handler which logs the error to the console. (Bitbake rev: 9e3f2e2d985a575adb5520d8b517eac5ad6a15ed) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index 37fc80e39e..b691a3bee8 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js @@ -20,6 +20,11 @@ var libtoaster = (function (){ source: function(query, process){ xhrParams.value = query; $.getJSON(xhrUrl, this.options.xhrParams, function(data){ + if (data.error != "ok") { + console.log("Error getting data from server "+data.error); + return; + } + return process (data.list); }); }, -- cgit v1.2.3-54-g00ecf