Skip to content
Snippets Groups Projects
Commit 0d104065 authored by buczekp's avatar buczekp
Browse files

[LMS-2368] fixed error message translation when modifying data set throws DB exception

SVN: 22078
parent b0972aa9
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.springframework.dao.DataAccessException;
import ch.rinn.restrictions.Friend;
import ch.systemsx.cisd.common.collections.CollectionUtils;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
......@@ -530,7 +532,13 @@ public class DataBO extends AbstractDataSetBusinessObject implements IDataBO
private void validateAndSave()
{
getDataDAO().validateAndSaveUpdatedEntity(data);
try
{
getDataDAO().validateAndSaveUpdatedEntity(data);
} catch (final DataAccessException ex)
{
throwException(ex, String.format("Data Set '%s'", data.getCode()));
}
}
private void updateParents(String[] modifiedParentDatasetCodesOrNull)
......@@ -593,7 +601,9 @@ public class DataBO extends AbstractDataSetBusinessObject implements IDataBO
return;
} else if (componentCodes.contains(data.getCode()))
{
throw new UserFailureException("Data set '" + data.getCode()
throw new UserFailureException(
"Data set '"
+ data.getCode()
+ "' cannot contain itself as a component neither directly nor via subordinate components.");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment