Class ValidationInsightSystemException

All Implemented Interfaces:
Serializable

@PublicApi public class ValidationInsightSystemException extends ValidationInsightException
This exception should only be seen as a start related to refactoring the "Validation exception" handling in Assets and will be changed in the future. Extends ValidationInsightException to impose NO structural changes in the code that throws ValidationInsightException today. Created to be able to differentiate between: 1) Validations due to "Invalid User input" or some violation of Assets business logic ValidationInsightException 2) Validations due to system inconsistency, like: object retrieved from DB is null, even though a "valid" id has been passed from the client. This exception aims to be used for situation (2), which gives the calling code a chance to capture it and perform specific post handling if desired.
Since:
4.3
Author:
Fredrik Karbing
See Also:
  • Constructor Details

    • ValidationInsightSystemException

      public ValidationInsightSystemException(String errorMessage)
  • Method Details

    • createBeanNotFoundByIdValidationException

      public static ValidationInsightSystemException createBeanNotFoundByIdValidationException(Class<?> beanClass, Object beanId, io.riada.insight.utils.I18n i18n)
    • stripBeanFromBeanClassName

      public static String stripBeanFromBeanClassName(Class<?> beanClass)
      Quite a few ValidationInsightSystemException return an error message providing the name of the bean that failed (not found, invalid, etc.). In order to use a generic way of providing messages like: "Could not find ExternalCSVConfiguration with id: " + id) this method takes a class and returns the simple name, stripping the trailing "Bean" part if present.
      Returns:
      The simple class name, without the trailing "Bean" if present.