Source:
<code>public FindEventsResponse getFindEventsResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final FindEventsAsyncRequest request) throws OsgpException { LOGGER.info("Get find events response for organisation: and device: {}.", organisationIdentification, request.getDeviceIdentification()); final FindEventsResponse response = new FindEventsResponse(); try { final List<MeterResponseData> meterResponseDataList = this.meterResponseDataService .dequeueMeterResponseData(request.getCorrelationUid()); final List<Event> events = this.getEventsFromMeterResponseData(meterResponseDataList); LOGGER.info("Get find events response: number of events: {}", events.size()); for (final Event event : events) { LOGGER.info("EventCode: {}, Timestamp: {}, EventCounter: {}", event.getEventCode(), event.getTimestamp(), event.getEventCounter()); } response.getEvents().addAll(this.managementMapper.mapAsList(events, com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event.class)); <START> for (final MeterResponseData meterResponseData : meterResponseDataList) { <END> this.throwExceptionIfResultNotOk(meterResponseData, "Find Events"); } response.setResult(OsgpResultType.OK); } catch (final MethodConstraintViolationException e) { LOGGER.error("FindEventsRequest Exception", e.getMessage(), e.getStackTrace(), e); throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.WS_SMART_METERING, new ValidationException(e.getConstraintViolations())); } catch (final Exception e) { this.handleException(e); } return response; }</code><technical_language>Check for NOT_OK processing events</technical_language>

Target:
public FindEventsResponse getFindEventsResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final FindEventsAsyncRequest request) throws OsgpException { LOGGER.info("Get find events response for organisation: and device: {}.", organisationIdentification, request.getDeviceIdentification()); final FindEventsResponse response = new FindEventsResponse(); try { final List<MeterResponseData> meterResponseDataList = this.meterResponseDataService .dequeueMeterResponseData(request.getCorrelationUid()); for (final MeterResponseData meterResponseData : meterResponseDataList) { this.throwExceptionIfResultNotOk(meterResponseData, "Find Events"); } final List<Event> events = this.getEventsFromMeterResponseData(meterResponseDataList); LOGGER.info("Get find events response: number of events: {}", events.size()); for (final Event event : events) { LOGGER.info("EventCode: {}, Timestamp: {}, EventCounter: {}", event.getEventCode(), event.getTimestamp(), event.getEventCounter()); } response.getEvents().addAll(this.managementMapper.mapAsList(events, com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event.class)); response.setResult(OsgpResultType.OK); } catch (final MethodConstraintViolationException e) { LOGGER.error("FindEventsRequest Exception", e.getMessage(), e.getStackTrace(), e); throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.WS_SMART_METERING, new ValidationException(e.getConstraintViolations())); } catch (final Exception e) { this.handleException(e); } return response; }