diff --git a/frontend-js/src/main/js/GuiConnector.js b/frontend-js/src/main/js/GuiConnector.js index 2f74cd06ebe9e40ced29e7a03c54e3d9e4b9992e..b15a812aaf317e9537f6f26afa06b8b32de0b8df 100644 --- a/frontend-js/src/main/js/GuiConnector.js +++ b/frontend-js/src/main/js/GuiConnector.js @@ -229,7 +229,7 @@ GuiConnector.prototype.hideProcessing = function () { /** * - * @param {string} error + * @param {string|Error} error * @param {boolean} [redirectIfSecurityError] */ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) { diff --git a/frontend-js/src/main/js/gui/admin/EditProjectDialog.js b/frontend-js/src/main/js/gui/admin/EditProjectDialog.js index 48302bde7f5e869b45a5431a2b8c4c20bf7415ba..6cf0bef6c26e521c5a66bb9939348f96a83de91a 100644 --- a/frontend-js/src/main/js/gui/admin/EditProjectDialog.js +++ b/frontend-js/src/main/js/gui/admin/EditProjectDialog.js @@ -10,6 +10,8 @@ var CommentsTab = require('./CommentsAdminPanel'); var GuiConnector = require('../../GuiConnector'); var PrivilegeType = require('../../map/data/PrivilegeType'); var ValidationError = require("../../ValidationError"); +var HttpStatus = require('http-status-codes'); +var NetworkError = require('../../NetworkError'); var Functions = require('../../Functions'); // noinspection JSUnusedLocalSymbols @@ -256,7 +258,14 @@ EditProjectDialog.prototype.createGeneralTabContent = function () { return self.callListeners("onSave"); }).then(function () { return self.close(); - }).catch(GuiConnector.alert); + }).catch(function (error) { + + if ((error instanceof NetworkError && error.statusCode === HttpStatus.BAD_REQUEST)) { + GuiConnector.alert(error.content.reason); + } else { + GuiConnector.alert(error); + } + }); }, xss: false });