- }catch (ForwardProgressException fpe){
- //No forward progress is being made
- String message = "GET:/pap/test called and PAP " + papResourceName + " is not making forward progress."
- + " Exception Message: " + fpe.getMessage();
- LOGGER.info(message);
- PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR + " " + message);
- loggingContext.transactionEnded();
- PolicyLogger.audit("Transaction Failed - See Error.log");
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
- return;
- }catch (AdministrativeStateException ase){
- //Administrative State is locked
- String message = "GET:/pap/test called and PAP " + papResourceName + " Administrative State is LOCKED "
- + " Exception Message: " + ase.getMessage();
- LOGGER.info(message);
- PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR + " " + message);
- loggingContext.transactionEnded();
- PolicyLogger.audit("Transaction Failed - See Error.log");
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
- return;
- }catch (StandbyStatusException sse){
- //Administrative State is locked
- String message = "GET:/pap/test called and PAP " + papResourceName + " Standby Status is NOT PROVIDING SERVICE "
- + " Exception Message: " + sse.getMessage();
- LOGGER.info(message);
+ }catch (ForwardProgressException | AdministrativeStateException | StandbyStatusException e){
+ String submsg;
+ if (e instanceof ForwardProgressException) {
+ submsg = " is not making forward progress.";
+ } else if (e instanceof AdministrativeStateException) {
+ submsg = " Administrative State is LOCKED.";
+ } else {
+ submsg = " Standby Status is NOT PROVIDING SERVICE.";
+ }
+
+ String message = "GET:/pap/test called and PAP " + papResourceName + submsg
+ + " Exception Message: " + e.getMessage();
+ LOGGER.info(message, e);