public static void changeAndThrowException(Throwable throwable, String customMessage) { Throwable newThrowable = createNewException(throwable, customMessage); //Attention: helper which allows to use a trick to throw a cached checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(newThrowable); }
public static RuntimeException throwAsRuntimeException(Throwable throwable) { //Attention: helper which allows to use a trick to throw // a catched checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(throwable); return null; //not needed due to the helper trick, but it's easier for using it }
public static void changeAndThrowException(Throwable throwable, String customMessage) { Throwable newThrowable = createNewException(throwable, customMessage); //Attention: helper which allows to use a trick to throw a cached checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(newThrowable); }
public static RuntimeException throwAsRuntimeException(Throwable throwable) { //Attention: helper which allows to use a trick to throw // a catched checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(throwable); return null; //not needed due to the helper trick, but it's easier for using it }
public static void changeAndThrowException(Throwable throwable, String customMessage) { Throwable newThrowable = createNewException(throwable, customMessage); //Attention: helper which allows to use a trick to throw a cached checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(newThrowable); }
public static RuntimeException throwAsRuntimeException(Throwable throwable) { //Attention: helper which allows to use a trick to throw // a catched checked exception without a wrapping exception new ExceptionHelper<RuntimeException>().throwException(throwable); return null; //not needed due to the helper trick, but it's easier for using it }