public class Exceptions extends Object
Modifier and Type | Method and Description |
---|---|
static Predicate<Throwable> |
exceptionsOfType(Class<? extends Throwable>... types) |
static <T extends Throwable> |
launderedException(Class<T> type,
String messageForUnexpected,
Throwable exception) |
static <T extends Throwable> |
launderedException(Class<T> type,
Throwable exception) |
static RuntimeException |
launderedException(String messageForUnexpected,
Throwable exception) |
static RuntimeException |
launderedException(Throwable exception) |
static Throwable |
peel(Throwable exception,
Predicate<Throwable> toPeel)
Peels off layers of causes.
|
static <T extends Throwable> |
withCause(T exception,
Throwable cause) |
public static RuntimeException launderedException(Throwable exception)
public static RuntimeException launderedException(String messageForUnexpected, Throwable exception)
public static <T extends Throwable> T launderedException(Class<T> type, Throwable exception)
public static <T extends Throwable> T launderedException(Class<T> type, String messageForUnexpected, Throwable exception)
public static Throwable peel(Throwable exception, Predicate<Throwable> toPeel)
exception
- the outer exception to peel to get to an delegate cause.toPeel
- Predicate
for deciding what to peel. true
means
to peel (i.e. remove), whereas the first false
means stop and return.Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.