Class ExceptionUtilities


  • public class ExceptionUtilities
    extends java.lang.Object
    Utilities class for Exception handling.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void throwConstraintViolationException​(org.springframework.transaction.TransactionSystemException exception, java.util.Locale locale, org.springframework.context.MessageSource messageSource)
      Method to unwrap a TransactionSystemException to create the error message from the root ConstraintViolationException cause and throw a UIConstraintViolationException.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionUtilities

        public ExceptionUtilities()
    • Method Detail

      • 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