Describe the bug
BadDataException is thrown from the Read function when "An inconsistent number of columns has been detected.". By passing this message to the base constructor, BadDataException forcibly replaces the exception message with the output of AddDetails, thus making it impossible to get the original "An inconsistent number of columns has been detected." message as string, for example inside a ReadingExceptionOccurred delegate implementation.
To Reproduce
- Use this setting:
configuration.ReadingExceptionOccurred = args =>
{
Console.WriteLine(args.Exception.Message);
return false;
};
- Parse a CSV with inconsistent line columns.
Expected behavior
I'd like to be able to retrieve the simpler message string without internal details in some way.