[go: nahoru, domu]

Skip to content

Commit

Permalink
Do not try to parse error response
Browse files Browse the repository at this point in the history
Issue #13130

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Apr 5, 2017
1 parent 946549d commit f5655f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,15 @@ var PMA_console = {
if (ajaxOptions.dataType && ajaxOptions.dataType.indexOf('json') != -1) {
return;
}
if (xhr.status !== 200) {
return;
}
try {
var data = JSON.parse(xhr.responseText);
PMA_console.ajaxCallback(data);
} catch (e) {
console.trace();
console.log("Invalid JSON!" + e.message);
console.log("Failed to parse JSON: " + e.message);
if (AJAX.xhr && AJAX.xhr.status === 0 && AJAX.xhr.statusText !== 'abort') {
PMA_ajaxShowMessage($('<div />',{'class':'error','html':PMA_messages.strRequestFailed+' ( '+escapeHtml(AJAX.xhr.statusText)+' )'}));
AJAX.active = false;
Expand Down

0 comments on commit f5655f4

Please sign in to comment.