diff options
author | Michael Wood <michael.g.wood@intel.com> | 2014-11-26 15:05:07 +0000 |
---|---|---|
committer | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-12-12 11:40:47 +0000 |
commit | 9e3f2e2d985a575adb5520d8b517eac5ad6a15ed (patch) | |
tree | 7b4de3233fff555851c18244e2d021ffa9529f58 /lib/toaster/toastergui/static/js/libtoaster.js | |
parent | c635dd71670030da78c52545d2bb32b8c485c1af (diff) | |
download | bitbake-contrib-9e3f2e2d985a575adb5520d8b517eac5ad6a15ed.tar.gz |
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.
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Diffstat (limited to 'lib/toaster/toastergui/static/js/libtoaster.js')
-rw-r--r-- | lib/toaster/toastergui/static/js/libtoaster.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/toaster/toastergui/static/js/libtoaster.js b/lib/toaster/toastergui/static/js/libtoaster.js index 37fc80e39..b691a3bee 100644 --- a/lib/toaster/toastergui/static/js/libtoaster.js +++ b/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); }); }, |