Don't use the $.getJSON method as it, as you are finding out, has no way to handle an error...
use the generic $.ajax instead var Params = {}; Params.type = "GET"; Params.url = "qtool"; Params.processData = true; Params.data = {action: "executeQuery", entity_name: queryText }; Params.dataType = "json"; Params.success = function(data) { alert(data); }; Params.error = function(x,y,z) { alert(x.responseText); }; $.ajax(Params); that way "x" will be the error response from the server (which apparently you are running into)