private void addErrorsFromShape(Model model, ShapeId source, List<ShapeId> errorShapeIds) {
        List<StructureShape> errorShapes = new ArrayList<>(errorShapeIds.size());
        Shape sourceShape = model.expectShape(source);
        for (ShapeId target : errorShapeIds) {
            model.getShape(target).flatMap(Shape::asStructureShape).ifPresent(errorShapes::add);
            boundErrorShapes.computeIfAbsent(target, id -> new HashSet<>()).add(sourceShape);
        }
        errors.put(source, errorShapes);
    }
Index of operation IDs to their resolved input, output, and error
structures.

<p>This index performs no validation that the input, output, and
errors actually reference valid structures. Such operation inputs,
outputs, and errors may be discarded as if they do not exist.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/OperationIndex.java