From a3979b8a14f6e67de406b29c3e0ad0c516c3bc54 Mon Sep 17 00:00:00 2001 From: "gregory.hayes" Date: Wed, 9 Dec 2020 20:42:33 +0000 Subject: Prune superfluous log and exception messages Large volume exception messages should not be repeated in log messages or in rethrown exceptions. Jira-Link: https://jira.onap.org/browse/POLICY-2885 Issue-ID: POLICY-2885 Signed-off-by: gregory.hayes Change-Id: I345531d3a7640cc5ad9dbfc367052b9c8cc19387 --- .../event/impl/jsonprotocolplugin/Apex2JsonEventConverter.java | 7 ++----- .../policy/apex/service/engine/main/ApexEventUnmarshaller.java | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'services/services-engine/src/main/java/org') diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JsonEventConverter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JsonEventConverter.java index 459a2c4bf..e8e592b09 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JsonEventConverter.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JsonEventConverter.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,10 +111,7 @@ public class Apex2JsonEventConverter implements ApexEventProtocolConverter { eventList.add(jsonStringApexEvent(eventName, jsonEventString)); } } catch (final Exception e) { - final String errorString = "Failed to unmarshal JSON event: " + e.getMessage() + ", event=" - + jsonEventString; - LOGGER.warn(errorString, e); - throw new ApexEventException(errorString, e); + throw new ApexEventException("Failed to unmarshal JSON event, event=" + jsonEventString, e); } // Return the list of events we have unmarshalled diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java index dc9854158..fd6ac4489 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java @@ -263,8 +263,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable { break; } catch (ApexException e) { if (!iterator.hasNext()) { - final String errorMessage = "Error while converting event into an ApexEvent for " + name + ": " - + e.getMessage() + ", Event=" + event; + final String errorMessage = "Error while converting event into an ApexEvent for " + name; throw new ApexEventException(errorMessage, e); } } -- cgit 1.2.3-korg