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 <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Wood
2014-11-26 15:05:07 +00:00
committed by Richard Purdie
parent c058c373f6
commit d5fc4f7f13

View File

@@ -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);
});
},