All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.core.exception.UnrecoverableExceptions Maven / Gradle / Ivy

There is a newer version: 7.20.1
Show newest version
package io.cucumber.core.exception;

/**
 * Utility for filtering out unrecoverable exceptions. Cucumber invokes methods
 * that may throw arbitrary exceptions. These can only be caught as
 * {@code Throwable}. Some of these such as {@link OutOfMemoryError} should
 * never be caught and end in termination of the application.
 */
public final class UnrecoverableExceptions {

    private UnrecoverableExceptions() {

    }

    public static void rethrowIfUnrecoverable(Throwable exception) {
        if (exception instanceof OutOfMemoryError) {
            ExceptionUtils.throwAsUncheckedException(exception);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy