
Originally Posted by
lucasward
I understand what you're trying to do much better, but it still doesn't quite make sense to me.
When you try and read from the third index (or even using the column name) you'll get an IndexOutOfBoundsException because there isn't a third value in the array. I could perhaps understand wanting to catch that and rethrow as something custom, although 'The File is not comma delimited' doesn't make too much sense to me. Just because one file is formatted incorrectly or is missing some data doesn't mean the whole file is necessarily formatted incorrectly. If you did decide to throw a custom exception, it will still be the 'cause' of the FlatFileParseException, so I don't see why you would want to replace the much more informative message.