mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-09-03 20:52:57 -05:00
Standardise the error handling for parsing of JSON response messages from the server. Fixes #3238
This commit is contained in:
@@ -97,15 +97,8 @@ define('pgadmin.dashboard', [
|
||||
Alertify.error(txtError);
|
||||
}
|
||||
},
|
||||
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);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user