From: RehanRaza Date: Tue, 3 Mar 2020 12:36:45 +0000 (+0100) Subject: Print the short description of exception in OscA1Client X-Git-Tag: 2.0.0~149^2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=189d22ac70cefa9d533d930bc728020a3e55ea11;p=nonrtric.git 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 --- 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); } }