dae2bf92b96f422a4502c0d5ded66f37f4c54456 larrym Wed Aug 29 17:30:13 2012 -0700 don't report ajax errors (#8816) diff --git src/hg/js/autocomplete.js src/hg/js/autocomplete.js index e458681..7dc4cfd 100644 --- src/hg/js/autocomplete.js +++ src/hg/js/autocomplete.js @@ -15,38 +15,32 @@ return function (request, callback) { var key = request.term; if(cache[key] == null) { $.ajax({ url: "../cgi-bin/hgSuggest", data: "db=" + db + "&prefix=" + encodeURIComponent(key), // dataType: "json", // XXXX this doesn't work under IE, so we retrieve as text and do an eval to force to an object. trueSuccess: function (response, status) { // We get a lot of duplicate requests (especially the first letters of words), // so we keep a cache of the suggestions lists we've retreived. cache[this.key] = response; this.cont(eval(response)); }, success: catchErrorOrDispatch, error: function (request, status, errorThrown) { - if (typeof console != "undefined") { - console.dir(request); - console.log(status); - } - var msg = "ajax call failed"; - if(status != "error") - msg = msg + "; error: " + status; - warn(msg + "; statusText: " + request.statusText + "; responseText: " + request.responseText); + // tolerate errors (i.e. don't report them) to avoid spamming people on flaky network connections + // with tons of error messages (#8816). }, key: key, cont: callback }); } else { callback(eval(cache[key])); } // warn(request.term); } }, clearFindMatches: function() { // clear any hgFind.matches set by a previous user selection (e.g. when user directly edits the search box) if($('#hgFindMatches').length)