System commands with ignore set to true also ignore http errors

This commit is contained in:
Gina Häußge 2015-06-22 16:55:32 +02:00
parent a580482c29
commit 1a7193e113

View file

@ -28,15 +28,17 @@ $(function() {
new PNotify({title: "Success", text: _.sprintf(gettext("The command \"%(command)s\" executed successfully"), {command: action.name}), type: "success"});
},
error: function(jqXHR, textStatus, errorThrown) {
var error = "<p>" + _.sprintf(gettext("The command \"%(command)s\" could not be executed."), {command: action.name}) + "</p>";
error += pnotifyAdditionalInfo("<pre>" + jqXHR.responseText + "</pre>");
new PNotify({title: gettext("Error"), text: error, type: "error", hide: false});
if (!action.hasOwnProperty("ignore") || !action.ignore) {
var error = "<p>" + _.sprintf(gettext("The command \"%(command)s\" could not be executed."), {command: action.name}) + "</p>";
error += pnotifyAdditionalInfo("<pre>" + jqXHR.responseText + "</pre>");
new PNotify({title: gettext("Error"), text: error, type: "error", hide: false});
}
}
})
};
if (action.confirm) {
showConfirmationDialog(action.confirm, function (e) {
callback();
callback();
});
} else {
callback();
@ -49,4 +51,4 @@ $(function() {
["loginStateViewModel", "appearanceViewModel", "settingsViewModel", "userSettingsViewModel"],
"#navbar"
]);
});
});