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() {
}
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);
} // 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);
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();
}
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);