-
Notifications
You must be signed in to change notification settings - Fork 46
RowNumber exception fix. #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… Subsequent calls to Read will also throw, but a different exception.
| } | ||
|
|
||
| [Fact] | ||
| public void Exception() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@loop-evgeny Take a look at this test and let me know if you think it covers the issue you reported in #262
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it does - thanks!
| else | ||
| { | ||
| // TODO: | ||
| throw new InvalidOperationException("The current row bla blah TODO"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not throw pendingException here instead, which contains more information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pending exception was already thrown the previous time Read was called. I'm trying to indicate that it is no longer valid to call Read, the reader is in an error state and can no longer be used. I need to write an actual useful error message, hence the TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind. I think you're right about this one. I was thinking about the other InvalidOperationException that is thrown from subsequent Read calls.
Reading after an exception is thrown will not advance the row number. Subsequent calls to Read will also throw, but a different exception type.
Potential fix for #262