public class Exceptions extends Object
Modifier and Type | Method and Description |
---|---|
static String |
briefOneLineStackTraceInformation(Predicate<StackTraceElement> toInclude) |
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 <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 void |
setMessage(Throwable cause,
String message) |
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) |
static <T extends Throwable> |
withSuppressed(T exception,
Throwable... suppressed) |
public static <T extends Throwable> T withSuppressed(T exception, Throwable... suppressed)
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 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 String briefOneLineStackTraceInformation(Predicate<StackTraceElement> toInclude)
Copyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.