CsvHelper icon indicating copy to clipboard operation
CsvHelper copied to clipboard

Expose underlying reader in CsvParser

Open ptsoccer opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. Back in version 19, you could access the Reader property in the ReadingContext, and from that you could access the underlying FileStream. This is helpful in cases where a parser exception occurred and bubbled up to a global handler. In the handler, you could dive into the CsvHelperException to get at the FileStream and pull out relevant details like the filename, row, and column to help understand what happened after the fact.

Describe the solution you'd like It would be nice for the reader variable to be exposed via a public property to debug issues after the fact.

Describe alternatives you've considered There's not much in the way of alternatives here. Reflection could access the private variable, but this is would be error prone.

ptsoccer avatar Aug 05 '22 19:08 ptsoccer