Class ExceptionUtils


  • public class ExceptionUtils
    extends java.lang.Object
    Exception utils.
    Since:
    1.0
    Author:
    Erhan Bagdemir
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void rethrow​(java.lang.Exception e, java.lang.Class<? extends java.lang.RuntimeException> exception)
      Rethrow any instance of RuntimeException by wrapping it into a new one, of which type passed as method parameter.
      static void rethrow​(java.lang.Exception e, java.lang.Class<? extends java.lang.RuntimeException> exception, java.lang.String message)
      Rethrow any instance of RuntimeException by wrapping it into a new one, of which type passed as method parameter while logging the error out.
      • Methods inherited from class java.lang.Object

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

      • rethrow

        public static void rethrow​(java.lang.Exception e,
                                   java.lang.Class<? extends java.lang.RuntimeException> exception,
                                   java.lang.String message)
        Rethrow any instance of RuntimeException by wrapping it into a new one, of which type passed as method parameter while logging the error out.
        Parameters:
        e - Exception instance, that is caught.
        exception - The new exception to be rethrown.
        message - Detailed message, that is output in the stdout.
      • rethrow

        public static void rethrow​(java.lang.Exception e,
                                   java.lang.Class<? extends java.lang.RuntimeException> exception)
        Rethrow any instance of RuntimeException by wrapping it into a new one, of which type passed as method parameter.
        Parameters:
        e - Exception instance, that is caught.
        exception - The new exception to be rethrown.