Standardise the error handling for parsing of JSON response messages from the server. Fixes #3238

This commit is contained in:
Dave Page
2018-05-04 16:56:15 +01:00
parent 4f79f00d61
commit 8937375885
17 changed files with 183 additions and 260 deletions

View File

@@ -208,15 +208,8 @@ define('pgadmin.node.database', [
t.unload(i);
}
},
error: function(xhr) {
try {
var err = $.parseJSON(xhr.responseText);
if (err.success == 0) {
Alertify.error(err.errormsg);
}
} catch (e) {
console.warn(e.stack || e);
}
error: function(xhr, status, error) {
Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
},
});