public class Exceptions extends Object
Modifier and Type | Method and Description |
---|---|
static String |
briefOneLineStackTraceInformation(Predicate<StackTraceElement> toInclude) |
static Predicate<StackTraceElement> |
classImplementingInterface(Class<org.neo4j.kernel.impl.locking.Locks.Client> cls) |
static <E extends Throwable> |
combine(E first,
E second) |
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 boolean |
containsStackTraceElement(Throwable cause,
Predicate<StackTraceElement> predicate) |
static Predicate<Throwable> |
exceptionsOfType(Class<? extends Throwable>... types) |
static Predicate<Throwable> |
exceptionWithMessage(String message) |
static Predicate<StackTraceElement> |
forMethod(String name) |
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) |
static <T extends Throwable> |
withMessage(T cause,
String message) |
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)
public static <E extends Throwable> E combine(E first, E second)
public static Predicate<StackTraceElement> classImplementingInterface(Class<org.neo4j.kernel.impl.locking.Locks.Client> cls)
public static boolean containsStackTraceElement(Throwable cause, Predicate<StackTraceElement> predicate)
public static Predicate<StackTraceElement> forMethod(String name)
public static String briefOneLineStackTraceInformation(Predicate<StackTraceElement> toInclude)
Copyright © 2002–2015 The Neo4j Graph Database Project. All rights reserved.