Class ValidationInsightSystemException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.riadalabs.jira.plugins.insight.common.exception.InsightException
com.riadalabs.jira.plugins.insight.common.exception.ValidationInsightException
com.riadalabs.jira.plugins.insight.common.exception.ValidationInsightSystemException
- All Implemented Interfaces:
Serializable
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateBeanNotFoundByIdValidationException
(Class<?> beanClass, Object beanId, io.riada.insight.utils.I18n i18n) 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.).Methods inherited from class com.riadalabs.jira.plugins.insight.common.exception.ValidationInsightException
getErrorContainer, getErrorMap, getFlattenErrorMessages, translateErrorMessage
Methods inherited from class com.riadalabs.jira.plugins.insight.common.exception.InsightException
getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Constructor Details
-
ValidationInsightSystemException
-
-
Method Details
-
createBeanNotFoundByIdValidationException
public static ValidationInsightSystemException createBeanNotFoundByIdValidationException(Class<?> beanClass, Object beanId, io.riada.insight.utils.I18n i18n) -
stripBeanFromBeanClassName
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.
-