mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Standardise the error handling for parsing of JSON response messages from the server. Fixes #3238
This commit is contained in:
@@ -691,13 +691,8 @@ define('pgadmin.browser', [
|
||||
modifyAnimation.modifyAcitreeAnimation(self);
|
||||
modifyAnimation.modifyAlertifyAnimation(self);
|
||||
},
|
||||
error: function(xhr) {
|
||||
try {
|
||||
var err = $.parseJSON(xhr.responseText);
|
||||
Alertify.alert(gettext('Preference loading failed.'),
|
||||
err.errormsg
|
||||
);
|
||||
} catch (e) { console.warn(e.stack || e); }
|
||||
error: function(xhr, status, error) {
|
||||
Alertify.pgRespErrorNotify(xhr, error);
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -1826,13 +1821,8 @@ define('pgadmin.browser', [
|
||||
}
|
||||
fetchNodeInfo(_callback);
|
||||
},
|
||||
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);
|
||||
fetchNodeInfo(_callback);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user