Fix ReCaptha NPE
Improve error handling when permission are removed.
This commit is contained in:
@@ -45,7 +45,8 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
events.onError();
|
||||
},
|
||||
onFailure:function (xhr) {
|
||||
events.onError();
|
||||
var responseText = xhr.responseText;
|
||||
events.onError(JSON.decode(responseText));
|
||||
},
|
||||
headers:{"Content-Type":"application/json", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
@@ -60,7 +61,6 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
async:false,
|
||||
method:'post',
|
||||
onSuccess:function () {
|
||||
console.log("Revert success ....");
|
||||
},
|
||||
onException:function () {
|
||||
},
|
||||
|
@@ -78,10 +78,14 @@ mindplot.widget.IMenu = new Class({
|
||||
}
|
||||
menu.setRequireChange(false);
|
||||
},
|
||||
onError:function () {
|
||||
onError:function (error) {
|
||||
if (saveHistory) {
|
||||
saveElem.setStyle('cursor', 'pointer');
|
||||
$notify($msg('SAVE_COULD_NOT_BE_COMPLETED'));
|
||||
var msg = error ? error.globalErrors : null;
|
||||
if (!msg) {
|
||||
msg = $msg('SAVE_COULD_NOT_BE_COMPLETED');
|
||||
}
|
||||
$notify(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user