mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-13 23:44:40 +03:00
Continue on parseJSON error (#708)
This commit is contained in:
parent
8a8b9f07fb
commit
605c483d5b
@ -85,7 +85,14 @@ function apiCall(method, path, params, cb) {
|
||||
return cb({ error: "Query timeout after " + timeout + "s" });
|
||||
}
|
||||
|
||||
cb(jQuery.parseJSON(xhr.responseText));
|
||||
var responseText;
|
||||
try {
|
||||
responseText = jQuery.parseJSON(xhr.responseText);
|
||||
}
|
||||
catch {
|
||||
responseText = { error: "Failed to parse the JSON response." };
|
||||
}
|
||||
cb(responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user