Class Exceptions


  • public final class Exceptions
    extends Object
    • Constructor Detail

      • Exceptions

        public Exceptions()
    • Method Detail

      • sneakyThrow

        public static <T extends Throwable,​R> R sneakyThrow​(Throwable t)
                                                           throws T extends Throwable
        Allows us to sneaky throw a checked exception without having to wrap it
        Use with caution
        Throws:
        T extends Throwable
      • getStackTrace

        public static String getStackTrace​(Throwable throwable)
        Get the stacktrace of the throwable as a String
        Parameters:
        throwable - the exception
        Returns:
        the throwable's full stacktrace