I know there is another thread on this but it didn't solve my problem, please read my question!
Basically, I'm parsing a YAML file to ensure it has all the correct keys and values I want. If the YAML file has an incorrect value or key that it needs to have, then I want to print a message that says where the incorrect value or key is.
Example:
Let's say for this YAML file:
Groceries:
Apples: Granny
Milk: Skim
Bread: Wheat
Let's say I was expecting 'Whole' as the value for 'Milk'. If that line is line 3, how do I print a message that says "error: invalid value blah blah on LINE 3"??
Thanks so much!