public class ThrowableUtils extends Object
| Constructor and Description |
|---|
ThrowableUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getSanitizedErrorMessage(Throwable error)
Returns a sanitized, prettified error message for the given throwable.
|
static String |
getSanitizedErrorMessage(Throwable error,
Predicate<Throwable> filter,
int indentation)
Returns a sanitized, prettified error message for the given throwable.
|
static boolean |
isInterrupted(Throwable throwable)
Returns
true when the given throwable, its cause, or any of its suppressed errors is an
InterruptedException or any of its common variants. |
public static boolean isInterrupted(@NonNull
Throwable throwable)
true when the given throwable, its cause, or any of its suppressed errors is an
InterruptedException or any of its common variants. Returns false otherwise.
This is mainly motivated by the fact the DSBulk engine uses the Reactor framework, which
sometimes wraps InterruptedException inside other exceptions, making it hard to detect
when the operation has been interrupted.
throwable - The throwable to inspect.@NonNull public static String getSanitizedErrorMessage(@NonNull Throwable error)
error - The throwable to extract a sanitized message from.@NonNull public static String getSanitizedErrorMessage(@NonNull Throwable error, @NonNull Predicate<Throwable> filter, int indentation)
error - The throwable to extract a sanitized message from.filter - A filter to eliminate unwanted/unnecessary errors.indentation - The number of spaces to add when indenting a new line of message.Copyright © 2017–2021 DataStax. All rights reserved.