Implement basic error handling in parseCSV function