From 0a358ea9fd56796d7dcf9c2a50df82a4f05b9738 Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Tue, 19 Mar 2019 14:27:16 +0100 Subject: Log stack traces with logger Fixed critical sonar issues: -"Either log or rethrow this exception" Change-Id: I99a550f2cf40bd6c34a0f8ca1893c964669c76de Issue-ID: MUSIC-367 Signed-off-by: Robert Bogacki --- src/main/java/org/onap/music/rest/RestMusicQAPI.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/onap/music/rest/RestMusicQAPI.java') diff --git a/src/main/java/org/onap/music/rest/RestMusicQAPI.java b/src/main/java/org/onap/music/rest/RestMusicQAPI.java index 676730e0..f3df9350 100755 --- a/src/main/java/org/onap/music/rest/RestMusicQAPI.java +++ b/src/main/java/org/onap/music/rest/RestMusicQAPI.java @@ -3,7 +3,9 @@ * org.onap.music * =================================================================== * Copyright (c) 2017 AT&T Intellectual Property + * =================================================================== * Modifications Copyright (C) 2019 IBM. + * Modifications Copyright (c) 2019 Samsung * =================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -376,7 +378,7 @@ public class RestMusicQAPI { queryObject = new RestMusicDataAPI().selectSpecificQuery(keyspace, tablename, info, limit); } catch (MusicServiceException ex) { logger.error(EELFLoggerDelegate.errorLogger, "", AppMessages.UNKNOWNERROR, - ErrorSeverity.WARN, ErrorTypes.GENERALSERVICEERROR); + ErrorSeverity.WARN, ErrorTypes.GENERALSERVICEERROR, ex); return response.status(Status.BAD_REQUEST) .entity(new JsonResponse(ResultType.FAILURE).setError(ex.getMessage()).toMap()) .build(); @@ -389,7 +391,7 @@ public class RestMusicQAPI { .setDataResult(MusicDataStoreHandle.marshallResults(results)).toMap()).build(); } catch (MusicServiceException ex) { logger.error(EELFLoggerDelegate.errorLogger, "", AppMessages.UNKNOWNERROR, - ErrorSeverity.ERROR, ErrorTypes.MUSICSERVICEERROR); + ErrorSeverity.ERROR, ErrorTypes.MUSICSERVICEERROR, ex); return response.status(Status.BAD_REQUEST) .entity(new JsonResponse(ResultType.FAILURE).setError(ex.getMessage()).toMap()) .build(); -- cgit 1.2.3-korg