private Set<ErrorMessage> addTo(Set<ErrorMessage> allErrors, List<ErrorMessage> errors) {
        if (errors.isEmpty()) return allErrors;

        if (allErrors == null)
            allErrors = new LinkedHashSet<>();
        allErrors.addAll(errors);
        return allErrors;
    }
This sets header and status from special Data items used for the purpose.
Do both at once to avoid traversing the data tree twice.
container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java