From a65e4772f4557a109917532b2d9c49680ce3bb15 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 14 Sep 2018 16:45:06 +0100 Subject: Fix exception not logged or rethrown Eclipse sonarlint does not check for exception dropping by default, it must be configured. This commit addresses exception dropping in apex. Change-Id: I406838990b3424c2912124b25d7326502cacc96c Issue-ID: POLICY-1034 Signed-off-by: liamfallon --- .../policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/plugins-context') diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java index 9cdb5845b..a9418d834 100644 --- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java +++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java @@ -70,7 +70,7 @@ public class AvroSchemaHelper extends AbstractSchemaHelper { } catch (final Exception e) { final String resultSting = userKey.getId() + ": avro context schema \"" + schema.getId() + "\" schema is invalid: " + e.getMessage() + ", schema: " + schema.getSchema(); - LOGGER.warn(resultSting); + LOGGER.warn(resultSting, e); throw new ContextRuntimeException(resultSting); } @@ -189,7 +189,7 @@ public class AvroSchemaHelper extends AbstractSchemaHelper { + (object != null ? object.getClass().getCanonicalName() : "null") + "\" must be assignable to \"" + getSchemaClass().getCanonicalName() + "\" or be a Json string representation of it for Avro unmarshalling"; - LOGGER.warn(returnString); + LOGGER.warn(returnString, e); throw new ContextRuntimeException(returnString); } } -- cgit 1.2.3-korg