mirror of
https://github.com/tommyskeff/futur4j.git
synced 2026-01-17 23:16:01 +00:00
don't log empty cancellation exceptions
This commit is contained in:
@@ -14,7 +14,7 @@ nexusPublishing {
|
|||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
group = 'dev.tommyjs'
|
group = 'dev.tommyjs'
|
||||||
version = '2.4.0'
|
version = '2.4.1'
|
||||||
|
|
||||||
apply plugin: 'java-library'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'com.github.johnrengelman.shadow'
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
|
|||||||
@@ -443,7 +443,14 @@ public abstract class AbstractPromise<T, FS, FA> implements Promise<T> {
|
|||||||
@Override
|
@Override
|
||||||
public @NotNull Promise<T> logExceptions(@NotNull String message) {
|
public @NotNull Promise<T> logExceptions(@NotNull String message) {
|
||||||
Exception wrapper = new DeferredExecutionException();
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user