public class SneakyThrow extends Object
RuntimeException.
It means to throw checked exception (subtype of Throwable or Exception) as un-checked exception.
This considers the Java 8 inference rule that states that a throws E is inferred as RuntimeException.| Modifier and Type | Method and Description |
|---|---|
static <E extends Throwable> |
sneakyThrow(Throwable e)
This method can be used in
throw statement
such as: throw sneakyThrow(exception);. |
Copyright © 2021 JBoss by Red Hat. All rights reserved.