Fix ReCaptha NPE

Improve error handling when permission are removed.
This commit is contained in:
Paulo Gustavo Veiga
2012-09-06 23:52:53 -03:00
parent 743164ade4
commit 337a67a8f6
12 changed files with 84 additions and 24 deletions

View File

@@ -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 () {
},

View File

@@ -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);
}
}
});