зеркало из https://github.com/mozilla/gecko-dev.git
Bug 468267 - Catch and report errors in search suggestions JSON response. r=gavin
This commit is contained in:
Родитель
0d091f0d6b
Коммит
d3c6837851
|
@ -315,7 +315,13 @@ SuggestAutoComplete.prototype = {
|
|||
|
||||
this._clearServerErrors();
|
||||
|
||||
var serverResults = JSON.parse(responseText);
|
||||
try {
|
||||
var serverResults = JSON.parse(responseText);
|
||||
} catch(ex) {
|
||||
Components.utils.reportError("Failed to parse JSON from " + this._suggestURI.spec + ": " + ex);
|
||||
return;
|
||||
}
|
||||
|
||||
var searchString = serverResults[0] || "";
|
||||
var results = serverResults[1] || [];
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче