diff options
author | r.bogacki <r.bogacki@samsung.com> | 2019-03-19 14:27:16 +0100 |
---|---|---|
committer | Robert Bogacki <r.bogacki@samsung.com> | 2019-03-28 06:56:23 +0000 |
commit | 0a358ea9fd56796d7dcf9c2a50df82a4f05b9738 (patch) | |
tree | 8236f863b96b429e109d398d992782b48c803104 /src/main/java/org/onap/music/main/MusicUtil.java | |
parent | cf8096a9fe50de511d5864032ed4825a2a314fa5 (diff) |
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 <r.bogacki@samsung.com>
Diffstat (limited to 'src/main/java/org/onap/music/main/MusicUtil.java')
-rwxr-xr-x | src/main/java/org/onap/music/main/MusicUtil.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/onap/music/main/MusicUtil.java b/src/main/java/org/onap/music/main/MusicUtil.java index b737377d..07612aa0 100755 --- a/src/main/java/org/onap/music/main/MusicUtil.java +++ b/src/main/java/org/onap/music/main/MusicUtil.java @@ -478,7 +478,7 @@ public class MusicUtil { // line fileScanner.close(); } catch (FileNotFoundException e) { - logger.error(EELFLoggerDelegate.errorLogger, e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), e); } return testType; @@ -492,7 +492,7 @@ public class MusicUtil { try { Thread.sleep(time); } catch (InterruptedException e) { - logger.error(EELFLoggerDelegate.errorLogger, e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(), e); Thread.currentThread().interrupt(); } } @@ -702,7 +702,7 @@ public class MusicUtil { input = MusicUtil.class.getClassLoader().getResourceAsStream("music.properties"); prop.load(input); } catch (Exception ex) { - logger.error(EELFLoggerDelegate.errorLogger, "Unable to find properties file."); + logger.error(EELFLoggerDelegate.errorLogger, "Unable to find properties file.", ex); throw new Exception(); } finally { if (input != null) { @@ -710,6 +710,7 @@ public class MusicUtil { input.close(); } catch (IOException e) { e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger, e); } } } @@ -824,7 +825,7 @@ public class MusicUtil { MusicDataStoreHandle.getDSHandle().executePut(updateQuery, "critical"); } catch (MusicServiceException | MusicQueryException e) { logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), AppMessages.QUERYERROR +""+updateQuery , - ErrorSeverity.MAJOR, ErrorTypes.QUERYERROR); + ErrorSeverity.MAJOR, ErrorTypes.QUERYERROR, e); } } |