HARMAN interview question

Programming logic and how to handle if it have errors