Source:
<code>public void processMessage(final ObjectMessage objectMessage) throws JMSException { LOGGER.debug("Processing smart metering periodic meter data response message"); String correlationUid = null; String messageType = null; String organisationIdentification = null; String deviceIdentification = null; final OsgpException osgpException = null; String result = null; String message = null; NotificationType notificationType = null; PeriodicMeterReadContainer data = null; try { correlationUid = objectMessage.getJMSCorrelationID(); messageType = objectMessage.getJMSType(); organisationIdentification = objectMessage.getStringProperty(Constants.ORGANISATION_IDENTIFICATION); deviceIdentification = objectMessage.getStringProperty(Constants.DEVICE_IDENTIFICATION); result = objectMessage.getStringProperty(Constants.RESULT); message = objectMessage.getStringProperty(Constants.DESCRIPTION); notificationType = NotificationType.valueOf(messageType); } catch (final JMSException e) { LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e); LOGGER.debug("correlationUid: {}", correlationUid); LOGGER.debug("messageType: {}", messageType); LOGGER.debug("organisationIdentification: {}", organisationIdentification); LOGGER.debug("deviceIdentification: {}", deviceIdentification); LOGGER.debug("osgpException: {}", osgpException); return; } try { LOGGER.info("Calling application service function to handle response: {}", messageType); final Object dataObject = objectMessage.getObject(); if (dataObject instanceof Exception) { <START> this.handleError((Exception) dataObject, correlationUid, organisationIdentification, <END> deviceIdentification, notificationType); } else { data = (PeriodicMeterReadContainer) dataObject; final MeterResponseData meterResponseData = new MeterResponseData(organisationIdentification, messageType, deviceIdentification, correlationUid, data); this.meterResponseDataRepository.save(meterResponseData); this.notificationService.sendNotification(organisationIdentification, deviceIdentification, result, correlationUid, message, notificationType); } } catch (final Exception e) { this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, notificationType); } }</code><technical_language>Check if dataObject exception, adjust in line other classes</technical_language>

Target:
public void processMessage(final ObjectMessage objectMessage) throws JMSException { LOGGER.debug("Processing smart metering periodic meter data response message"); String correlationUid = null; String messageType = null; String organisationIdentification = null; String deviceIdentification = null; final OsgpException osgpException = null; String result = null; String message = null; NotificationType notificationType = null; PeriodicMeterReadContainer data = null; try { correlationUid = objectMessage.getJMSCorrelationID(); messageType = objectMessage.getJMSType(); organisationIdentification = objectMessage.getStringProperty(Constants.ORGANISATION_IDENTIFICATION); deviceIdentification = objectMessage.getStringProperty(Constants.DEVICE_IDENTIFICATION); result = objectMessage.getStringProperty(Constants.RESULT); message = objectMessage.getStringProperty(Constants.DESCRIPTION); notificationType = NotificationType.valueOf(messageType); } catch (final JMSException e) { LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e); LOGGER.debug("correlationUid: {}", correlationUid); LOGGER.debug("messageType: {}", messageType); LOGGER.debug("organisationIdentification: {}", organisationIdentification); LOGGER.debug("deviceIdentification: {}", deviceIdentification); LOGGER.debug("osgpException: {}", osgpException); return; } try { LOGGER.info("Calling application service function to handle response: {}", messageType); data = (PeriodicMeterReadContainer) objectMessage.getObject(); final MeterResponseData meterResponseData = new MeterResponseData(organisationIdentification, messageType, deviceIdentification, correlationUid, data); this.meterResponseDataRepository.save(meterResponseData); this.notificationService.sendNotification(organisationIdentification, deviceIdentification, result, correlationUid, message, notificationType); } catch (final Exception e) { this.handleError(e, correlationUid, organisationIdentification, deviceIdentification, notificationType); } }