diff options
Diffstat (limited to 'vid-app-common/src')
4 files changed, 10 insertions, 7 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java index 6a8439fee..1710d984f 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java @@ -195,6 +195,7 @@ public class AaiClient implements AaiClientInterface { return new AaiResponse(e.getCause(), "AAI response parsing Error" , HttpStatus.SC_INTERNAL_SERVER_ERROR); } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger,"Exception in aai response parsing", e); return new AaiResponse(e.getCause(), "Got " + aaiResponse.getHttpCode() + " from a&ai" , aaiResponse.getHttpCode()); } } @@ -335,8 +336,8 @@ public class AaiClient implements AaiClientInterface { encodedParam= URLEncoder.encode(param, "UTF-8"); } catch (UnsupportedEncodingException e) { String methodName = "getUrlFromList"; - logger.error(EELFLoggerDelegate.errorLogger, methodName + e.toString()); - logger.debug(EELFLoggerDelegate.debugLogger, methodName + e.toString()); + logger.error(EELFLoggerDelegate.errorLogger, methodName, e); + logger.debug(EELFLoggerDelegate.debugLogger, methodName, e); } url = url.concat(encodedParam); if(i != params.size()){ diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/PombaClientImpl.java b/vid-app-common/src/main/java/org/onap/vid/aai/PombaClientImpl.java index 1ee4da0b4..5641bc502 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/PombaClientImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/PombaClientImpl.java @@ -51,8 +51,8 @@ public class PombaClientImpl implements PombaClientInterface { try { pombaRestInterface.RestPost(fromAppId, uri, new ObjectMapper().writeValueAsString(request)); } catch (Exception e) { - logger.info(EELFLoggerDelegate.errorLogger, methodName + e.toString()); - logger.debug(EELFLoggerDelegate.debugLogger, methodName + e.toString()); + logger.info(EELFLoggerDelegate.errorLogger, methodName, e); + logger.debug(EELFLoggerDelegate.debugLogger, methodName, e); } } } diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java index 129a61041..b118901a4 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java @@ -50,8 +50,8 @@ public class PombaRestInterface extends AAIRestInterface { client = httpsAuthClientFactory.getClient(HttpClientMode.WITH_KEYSTORE); } catch (Exception e) { - logger.info(EELFLoggerDelegate.errorLogger, "Exception in REST call to DB in initRestClient" + e.toString()); - logger.debug(EELFLoggerDelegate.debugLogger, "Exception in REST call to DB : " + e.toString()); + logger.info(EELFLoggerDelegate.errorLogger, "Exception in REST call to DB in initRestClient", e); + logger.debug(EELFLoggerDelegate.debugLogger, "Exception in REST call to DB : ", e); } } } diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java index 4a5564e9c..4aabdae21 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java @@ -197,7 +197,9 @@ public class CsvServiceImpl implements CsvService{ currentJson.put(new JSONObject().put(key, values)); } else { JSONObject lastItem = lastItemInArray(currentJson); - lastItem.put(key, values); + if(lastItem != null) { + lastItem.put(key, values); + } } } } |