Class Exceptions


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

      Constructors 
      Constructor Description
      Exceptions()  
    • 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 logMsg)
      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
    • Constructor Detail

      • Exceptions

        public Exceptions()
    • Method Detail

      • rethrow

        public static void rethrow​(java.lang.Exception e,
                                   java.lang.Class<? extends java.lang.RuntimeException> exception,
                                   java.lang.String logMsg)
        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.
        logMsg - Log message.
      • 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.