aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-03-03 14:57:35 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-03 14:57:35 +0000
commita0780033bbd69d3e8f68c9e2cfef24bb83d4eae9 (patch)
treefa4698371e33d090cf806c8d827e96a85b0f290c /models-interactions
parenteeaffa39795210244f8ae1fe4c6620026d43bd05 (diff)
parent4b402bec858a8e955d85fb872eecbad4023b15ba (diff)
Merge "Don't log cancellation exception"
Diffstat (limited to 'models-interactions')
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java
index 04360447c..653f569bd 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java
@@ -28,6 +28,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
+import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.Executor;
@@ -528,8 +529,14 @@ public abstract class OperationPartial implements Operation {
return thrown -> {
OperationOutcome outcome = params.makeOutcome();
- logger.warn("exception throw by {} {}.{} for {}", type, outcome.getActor(), outcome.getOperation(),
- params.getRequestId(), thrown);
+ if (thrown instanceof CancellationException || thrown.getCause() instanceof CancellationException) {
+ // do not include exception in the message, as it just clutters the log
+ logger.warn("{} canceled {}.{} for {}", type, outcome.getActor(), outcome.getOperation(),
+ params.getRequestId());
+ } else {
+ logger.warn("exception throw by {} {}.{} for {}", type, outcome.getActor(), outcome.getOperation(),
+ params.getRequestId(), thrown);
+ }
return setOutcome(outcome, thrown);
};