java.lang.Object
is.codion.common.utilities.exceptions.Exceptions

public final class Exceptions extends Object
Exception handling utilities.
  • Method Details

    • runtime

      public static RuntimeException runtime(Throwable throwable, Class<? extends Throwable>... unwrap)
      Returns the given Throwable in case it is a RuntimeException or else a RuntimeException wrapping it.
      Parameters:
      throwable - the throwable
      unwrap - unwraps these exceptions
    • unwrap

      public static Throwable unwrap(Throwable throwable, Collection<Class<? extends Throwable>> unwrap)
      Unwraps the given throwable.
      Parameters:
      throwable - the exception to unwrap
      unwrap - the exception types to unwrap
      Returns:
      the unwrapped exception