- java.lang.Object
-
- dk.cloudcreate.essentials.shared.Exceptions
-
public final class Exceptions extends Object
-
-
Constructor Summary
Constructors Constructor Description Exceptions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThrowablegetRootCause(Throwable exception)Get the root cause (top most parent) of an Exception.static StringgetStackTrace(Throwable throwable)Get the stacktrace of thethrowableas a Stringstatic <T extends Throwable,R>
RsneakyThrow(Throwable t)Allows us to sneaky throw a checked exception without having to wrap it
Use with caution
-
-
-
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 thethrowableas a String- Parameters:
throwable- the exception- Returns:
- the
throwable's full stacktrace
-
-