@Override
        public OutputStream getOutputStream(final byte[] header, final byte[] footer) {
            if (processInfoOutputStream == null) {
                String processorUuid = null;
                Integer processorFilterId = null;
                String pipelineUuid = null;
                Long processorTaskId = null;

                if (processor != null) {
                    processorUuid = processor.getUuid();
                    pipelineUuid = processor.getPipelineUuid();
                }
                if (processorFilter != null) {
                    processorFilterId = processorFilter.getId();
                }
                if (processorTask != null) {
                    processorTaskId = processorTask.getId();
                }

                // Create a processing info stream to write all processing
                // information to.
                final MetaProperties dataProperties = MetaProperties.builder()
                        .feedName(feedName)
                        .typeName(StreamTypeNames.ERROR)
                        .parent(meta)
                        .processorUuid(processorUuid)
                        .pipelineUuid(pipelineUuid)
                        .processorFilterId(processorFilterId)
                        .processorTaskId(processorTaskId)
                        .build();

                final String volumeGroupName = volumeGroupNameProvider
                        .getVolumeGroupName(meta.getFeedName(), StreamTypeNames.ERROR, null);
                processInfoStreamTarget = streamStore.openTarget(dataProperties, volumeGroupName);
                processInfoOutputStream = new WrappedOutputStream(processInfoStreamTarget.next().get()) {
                    @Override
                    public void close() throws IOException {
                        try {
                            super.flush();
                            super.close();

                        } finally {
                            // Only do something if an output stream was used.
                            if (processInfoStreamTarget != null) {
                                // Write meta data.
                                final AttributeMap attributeMap = metaData.getAttributes();
                                processInfoStreamTarget.getAttributes().putAll(attributeMap);

                                try {
                                    // Write statistics meta data.
                                    // Get current process statistics
                                    final ProcessStatistics processStatistics = ProcessStatisticsFactory.create(
                                            recordCount, errorReceiverProxy);
                                    processStatistics.write(processInfoStreamTarget.getAttributes());
                                } catch (final RuntimeException e) {
                                    LOGGER.error(e::getMessage, e);
                                }

                                // Close the stream target.
                                try {
                                    processInfoStreamTarget.close();
                                } catch (final RuntimeException e) {
                                    LOGGER.error(e::getMessage, e);
                                }
                            }
                        }
                    }
                };
            }

            return processInfoOutputStream;
        }
Used to handle any errors that may occur during translation.
stroom-core/src/main/java/stroom/core/dataprocess/AbstractProcessorTaskExecutor.java