From 189d22ac70cefa9d533d930bc728020a3e55ea11 Mon Sep 17 00:00:00 2001 From: RehanRaza Date: Tue, 3 Mar 2020 13:36:45 +0100 Subject: [PATCH] Print the short description of exception in OscA1Client Avoid garbage from running the unit-tests which cause exceptions. Now, it prints just one line: ERROR org.oransc.policyagent.clients.OscA1Client - Unexpected response for policy type: {"type":"type1"}, exception: org.json.JSONException: JSONObject["create_schema"] not found. Change-Id: I6c5d0037b9d068a1fd069d521af1070a8ec55c54 Signed-off-by: RehanRaza --- .../src/main/java/org/oransc/policyagent/clients/OscA1Client.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java b/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java index 3216a48d..c596bd59 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java @@ -22,12 +22,14 @@ package org.oransc.policyagent.clients; import java.lang.invoke.MethodHandles; import java.util.List; + import org.json.JSONObject; import org.oransc.policyagent.configuration.RicConfig; import org.oransc.policyagent.repository.Policy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.util.UriComponentsBuilder; + import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -135,7 +137,7 @@ public class OscA1Client implements A1Client { schemaObj.put(TITLE, policyTypeId); return Mono.just(schemaObj.toString()); } catch (Exception e) { - logger.error("Unexcpected response for policy type: {}", policyTypeResponse, e); + logger.error("Unexpected response for policy type: {}, exception: {}", policyTypeResponse, e.toString()); return Mono.error(e); } } -- 2.16.6