Display proper error message on save of invalid project settings

Let the user know which project setting is invalid, e.g. if the user
types in an invalid max object size limit.

Change-Id: Iac237e83366c783a77068a50d57404fa2341fd1b
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin 2013-07-17 15:38:39 +02:00 committed by David Pursehouse
parent 489b0f5db6
commit cc9822937d

View File

@ -124,7 +124,12 @@ public class PutConfig implements RestModifyView<ProjectResource, Input> {
(new PerRequestProjectControlCache(projectCache, self.get()))
.evict(projectConfig.getProject());
} catch (IOException e) {
throw new ResourceConflictException("Cannot update " + projectName);
if (e.getCause() instanceof ConfigInvalidException) {
throw new ResourceConflictException("Cannot update " + projectName
+ ": " + e.getCause().getMessage());
} else {
throw new ResourceConflictException("Cannot update " + projectName);
}
}
return new ConfigInfo(projectStateFactory.create(projectConfig), config);
} catch (ConfigInvalidException err) {