Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

CSVParser and user_error


Reply


212 Views

Avatar
Futureweb

Community Member, 233 Posts

26 August 2013 at 4:30pm

Hi folks,

I'm using the CSVParser class to handle a CSV file, mostly fine, but if the CSV has the wrong number of items in a row, it creates a 'user_error', resulting a blue blue screen...

2 questions:

Does anyone know of a way of checking the column rows in the CSV before asking CSVParser to parse the file

Does anyone know of a way of taking a generated 'user_error' and presenting it nicely to the user, rather than dying on a big blue screen!

Or - or the CSVParser class just not up to it, and should I be using CsvBulkLoader instead?