Class SpringExceptionUtil


  • public class SpringExceptionUtil
    extends Object
    Simple utils for exceptions manipulating.
    • Constructor Detail

      • SpringExceptionUtil

        public SpringExceptionUtil()
    • Method Detail

      • unrollException

        public static Throwable unrollException​(Throwable exception,
                                                Set<Class> nonInterestingClasses)
        Unrolls exception stack. In other words, removes non-interesting wrapping excpetion classes.

        In other words, if the given exceptions contains nested exceptions (in the "cause" property), this function will remove a wrapping (outside) exception while it is a non-interesting one.

        Parameters:
        exception - an exception to unroll.
        nonInterestingClasses - non-interesting exception classes.
        Returns:
        inner exception.