public class Exceptions extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
contains(Throwable cause,
Class... anyOfTheseClasses) |
static boolean |
contains(Throwable cause,
Predicate<Throwable> toLookFor) |
static boolean |
contains(Throwable cause,
String containsMessage,
Class... anyOfTheseClasses) |
static Predicate<Throwable> |
exceptionsOfType(Class<? extends Throwable>... types) |
static Predicate<Throwable> |
isAnyOfClasses(Class... anyOfTheseClasses) |
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 Throwable |
rootCause(Throwable caughtException) |
static String |
stringify(Thread thread,
StackTraceElement[] elements) |
static String |
stringify(Throwable cause) |
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.public static Predicate<Throwable> exceptionsOfType(Class<? extends Throwable>... types)
public static String stringify(Thread thread, StackTraceElement[] elements)
public static boolean contains(Throwable cause, String containsMessage, Class... anyOfTheseClasses)
Copyright © 2002–2013 The Neo4j Graph Database Project. All rights reserved.