Check for TypeError for invalid enum values as function parameters