private boolean servicesContainError(Model model, OperationShape shape, ShapeId errorId) {
        TopDownIndex topDownIndex = TopDownIndex.of(model);

        Set<ServiceShape> services = model.getServiceShapes();
        if (services.isEmpty()) {
            return false;
        }

        for (ServiceShape service : services) {
            // Skip if the service doesn't have the operation.
            if (!topDownIndex.getContainedOperations(service).contains(shape)) {
                continue;
            }

            // We've already checked if the operation contains the error,
            // so a service having no errors means we've failed.
            if (service.getErrors().isEmpty() || !service.getErrors().contains(errorId)) {
                return false;
            }
        }

        return true;
    }
Validates that examples traits are valid for their operations.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExamplesTraitValidator.java