diff options
author | burdziak <olaf.burdziakowski@nokia.com> | 2019-06-07 14:18:09 +0200 |
---|---|---|
committer | burdziak <olaf.burdziakowski@nokia.com> | 2019-06-07 14:18:09 +0200 |
commit | 645d9c71b5f1c613399a89ed069cc03d6a596980 (patch) | |
tree | c5761bd730e7782420b3c6c59bea1d5b713b8381 /ecomp-sdk/epsdk-analytics/src | |
parent | 2ff08984288baa289367ffc808717a9dfe38717b (diff) |
Fix soner issues in ErrorHandler
Change-Id: I4d1954b25dc171eb344ce1d6523742f5defc5f0d
Issue-ID: PORTAL-523
Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ErrorHandler.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ErrorHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ErrorHandler.java index 1a31e604..30ec7b15 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ErrorHandler.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/controller/ErrorHandler.java @@ -63,6 +63,9 @@ import com.fasterxml.jackson.databind.SerializationFeature; public class ErrorHandler extends org.onap.portalsdk.analytics.RaptorObject { private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ErrorHandler.class); + + private static final String EXCEPTION_FATAL_ERROR = "[EXCEPTION ENCOUNTERED IN RAPTOR] Fatal error ["; + private static final String C_ERROR_SQL = "c_error_sql"; public ErrorHandler() { } @@ -105,11 +108,11 @@ public class ErrorHandler extends org.onap.portalsdk.analytics.RaptorObject { return sessionLogStrBuf.toString(); } public String processFatalError(HttpServletRequest request, RaptorException e) { - logger.error(EELFLoggerDelegate.debugLogger, ("[EXCEPTION ENCOUNTERED IN RAPTOR] Fatal error [" + e.getClass().getName() + "]: " + nvl(e.getMessage())+" "+ getSessionLog(request) + e.getMessage()),AlarmSeverityEnum.MAJOR); + logger.error(EELFLoggerDelegate.debugLogger, (EXCEPTION_FATAL_ERROR + e.getClass().getName() + "]: " + nvl(e.getMessage())+" "+ getSessionLog(request) + e.getMessage()),AlarmSeverityEnum.MAJOR); if (e instanceof ReportSQLException) { String errorSQL = ((ReportSQLException) e).getReportSQL(); if (nvl(errorSQL).length() > 0) - request.setAttribute("c_error_sql", errorSQL); + request.setAttribute(C_ERROR_SQL, errorSQL); } // if AppUtils.processErrorNotification(request, e); @@ -118,11 +121,11 @@ public class ErrorHandler extends org.onap.portalsdk.analytics.RaptorObject { } // processFatalError public String processFatalErrorJSON(HttpServletRequest request, RaptorException e) { - logger.error(EELFLoggerDelegate.debugLogger, ("[EXCEPTION ENCOUNTERED IN RAPTOR] Fatal error [" + e.getClass().getName() + "]: " + nvl(e.getMessage())+" "+ getSessionLog(request) + e.getMessage()),AlarmSeverityEnum.MAJOR); + logger.error(EELFLoggerDelegate.debugLogger, (EXCEPTION_FATAL_ERROR + e.getClass().getName() + "]: " + nvl(e.getMessage())+" "+ getSessionLog(request) + e.getMessage()),AlarmSeverityEnum.MAJOR); if (e instanceof ReportSQLException) { String errorSQL = ((ReportSQLException) e).getReportSQL(); if (nvl(errorSQL).length() > 0) - request.setAttribute("c_error_sql", errorSQL); + request.setAttribute(C_ERROR_SQL, errorSQL); } // if request.setAttribute(AppConstants.RI_EXCEPTION, e); @@ -136,7 +139,7 @@ public class ErrorHandler extends org.onap.portalsdk.analytics.RaptorObject { try { jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(errorJSONRuntime); } catch (Exception ex) { - logger.error(EELFLoggerDelegate.debugLogger, ("[EXCEPTION ENCOUNTERED IN RAPTOR] Fatal error [" + ex.getClass().getName() + "]: " + nvl(ex.getMessage())+" "+ getSessionLog(request) + ex.getMessage()),AlarmSeverityEnum.MAJOR); + logger.error(EELFLoggerDelegate.debugLogger, (EXCEPTION_FATAL_ERROR + ex.getClass().getName() + "]: " + nvl(ex.getMessage())+" "+ getSessionLog(request) + ex.getMessage()),AlarmSeverityEnum.MAJOR); ex.printStackTrace(); } @@ -150,11 +153,11 @@ public class ErrorHandler extends org.onap.portalsdk.analytics.RaptorObject { return result.toString(); } public String processFatalErrorWMenu(HttpServletRequest request, RaptorException e) { - logger.error(EELFLoggerDelegate.debugLogger, ("[EXCEPTION ENCOUNTERED IN RAPTOR] Fatal error [" + e.getClass().getName() + "]: " + nvl(e.getMessage())+" "+ getSessionLog(request) + e.getMessage()),AlarmSeverityEnum.MAJOR); + logger.error(EELFLoggerDelegate.debugLogger, (EXCEPTION_FATAL_ERROR + e.getClass().getName() + "]: " + nvl(e.getMessage())+" "+ getSessionLog(request) + e.getMessage()),AlarmSeverityEnum.MAJOR); if (e instanceof ReportSQLException) { String errorSQL = ((ReportSQLException) e).getReportSQL(); if (nvl(errorSQL).length() > 0) - request.setAttribute("c_error_sql", errorSQL); + request.setAttribute(C_ERROR_SQL, errorSQL); } // if AppUtils.processErrorNotification(request, e); |