throwConstraintViolationException
public static void throwConstraintViolationException(org.springframework.transaction.TransactionSystemException exception,
java.util.Locale locale,
org.springframework.context.MessageSource messageSource)
throws UIConstraintViolationException
Method to unwrap a TransactionSystemException
to create the error message from the root
ConstraintViolationException
cause and throw a UIConstraintViolationException. Required when using the
hibernate validator in a @Transactional as the root cause is wrapped in a
TransactionSystemException
- Parameters:
exception
- The exception to get the root cause from
locale
- Current users Locale
messageSource
- the message source for i18n
- Throws:
UIConstraintViolationException
- if a project owners metadata role is set to anything other than the
highest level