mirror of
https://github.com/tommyskeff/futur4j.git
synced 2026-01-18 07:16:45 +00:00
don't log empty cancellation exceptions
This commit is contained in:
@@ -443,7 +443,14 @@ public abstract class AbstractPromise<T, FS, FA> implements Promise<T> {
|
||||
@Override
|
||||
public @NotNull Promise<T> logExceptions(@NotNull String message) {
|
||||
Exception wrapper = new DeferredExecutionException();
|
||||
return onError(e -> getLogger().error(message, wrapper.initCause(e)));
|
||||
return onError(e -> {
|
||||
if (e instanceof CancellationException && e.getMessage() == null && e.getCause() == null) {
|
||||
// Ignore cancellation exceptions without a message or cause
|
||||
return;
|
||||
}
|
||||
|
||||
getLogger().error(message, wrapper.initCause(e));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user