java.lang.Object
dk.cloudcreate.essentials.shared.Exceptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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>
RAllows us to sneaky throw a checked exception without having to wrap it
Use with caution
-
Constructor Details
-
Exceptions
public Exceptions()
-
-
Method Details
-
sneakyThrow
Allows us to sneaky throw a checked exception without having to wrap it
Use with caution- Throws:
T extends Throwable
-
getStackTrace
Get the stacktrace of thethrowableas a String- Parameters:
throwable- the exception- Returns:
- the
throwable's full stacktrace
-
getRootCause
Get the root cause (top most parent) of an Exception.- Parameters:
exception- the exception we want the root cause of- Returns:
- the root cause of the exception - will never be null
-