-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Query: Throw better exception when reading incorrect data for relational providers #6471
Comments
@ErikEJ I think this is fine. The point of this test was to throw with a better message for providers that grab the value from the data reader as an object. I believe that currently this is only SQL Server. Every other provider will throw when reading out of the data reader. This is why the test is skipped for SQLite. |
@ajcvickers Thanks, yes, I saw the tests were disabled for sqlite, but I was also unsure abot the purpose of the introduced message - since it is in Relational, and not in the SQL Server provider |
AFAIR it is how @ajcvickers said. I guess we could add a comment somewhere in these tests to clarify the intent to provider writers. Also I am thinking we could refactor the tests to allow provider writers to override the assertion and match whatever exception their providers would throw. At least that way provider writers would have a chance to asses if the exception is clear enough or if they want to do something specific in their providers to throw a better exception. But I am not sure there is enough value in that. |
Initial thought is that we should make the improved error handling work for these providers, too. I can't remember whether there was something fundamental blocking it, but it looks like we just need to gen the try/catch stuff in TypedRelationalValueBufferFactoryFactory. Re-opening. |
Don't know if this is related to this issue, but I also have encountered the InvalidCastException on the SQL Server relational provider, which does not provide any additional information nor meaning. Just from the message, I can't figure out, which of the columns from the SQL cannot be handled correctly. A message would be good to show, which of the columns is actually causing the problem. Here is the log output of the EF ILoggerProvider: |
@hkoestin Which version of EF Core? |
Sorry for the late reply. It is core 1.0.1 with relational provider 1.0.1 On Wed, Sep 28, 2016 at 8:03 PM, Andrew Peters [email protected]
|
Steps to reproduce
Running the OptimisticConcurrencyTestBase tests with the SQLCE 1.1 alpha provider
The issue
Instead of the expected InvalidOperationException, InvalidCastException is thrown (from the ADO.NET provider)
Further technical details
EF Core version: 1.1.0-alpha1-21973
Operating system: Win 10
Visual Studio version: VS 2015 Update 3
The text was updated successfully, but these errors were encountered: