private Optional<ValidationEvent> validateError(StructureShape shape, ErrorTrait error) {
        return shape.getTrait(HttpErrorTrait.class).flatMap(httpErrorTrait -> {
            // Make sure that client errors are 4xx, and server errors are 5xx.
            int code = httpErrorTrait.getCode();
            if (error.isClientError() && (code < 400 || code >= 500)) {
                return Optional.of(invalidError(shape, httpErrorTrait, code, "4xx", error.getValue()));
            } else if (error.isServerError() && (code < 500 || code >= 600)) {
                return Optional.of(invalidError(shape, httpErrorTrait, code, "5xx", error.getValue()));
            } else {
                return Optional.empty();
            }
        });
    }
Ensures that HTTP response codes are appropriate for operations and errors.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpResponseCodeSemanticsValidator.java