private static void failInvalidEnum(Object val, String defName, String defKey) {
        throw new IllegalArgumentException("Invalid enum value '" + val + "' for '" + defKey +
                                           "' in definition '" + defName);
    }
Throws if the given value is not legal.
config/src/main/java/com/yahoo/vespa/config/ConfigDefinition.java