Return errors when generating with invalid enum types.