Skip to content
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

QueryRewrite: materializer doesn't intercept reader exceptions #15751

Closed
roji opened this issue May 18, 2019 · 6 comments · Fixed by #20367
Closed

QueryRewrite: materializer doesn't intercept reader exceptions #15751

roji opened this issue May 18, 2019 · 6 comments · Fixed by #20367
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-3.0 type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented May 18, 2019

In the old pipeline we had TypedRelationalValueBufferFactoryFactory.ThrowReadValueException() intercepting exceptions and throwing threw InvalidOperationException with more detailed messages (including entity name, property name, etc.). We should bring this back in the new pipeline.

Note: the old implementation always threw InvalidOperationException, including for InvalidCastExceptions coming out of the database layer. We should probably change this to throw InvalidCastException instead.

Tests blocked by this (there are probably more):

  • FromSqlQueryTestBase.Bad_data_*
  • FromSqlQueryTestBase.FromSqlRaw_queryable_simple_columns_out_of_order_and_not_enough_columns_throws
  • FromSqlQueryTestBase.From_sql_queryable_simple_columns_out_of_order_and_not_enough_columns_throws
@smitpatel
Copy link
Member

smitpatel commented May 18, 2019

Throwing any exception in new pipeline is not implemented yet.

https://github.com/aspnet/EntityFrameworkCore/blob/4b2e969d4b131ad992e270d8f65510e091e8eb4d/src/EFCore.Relational/Query/Pipeline/RelationalShapedQueryCompilingExpressionVisitor.cs#L373-L400

@roji
Copy link
Member Author

roji commented May 18, 2019

Throwing any exception in new pipeline is not implemented yet.

OK. Right now SqlException bubbles up from SqlClient which seems fine. Am not sure this is totally critical for 3.0, we can discuss - I'll update with tests that depend on this as I see them.

@smitpatel
Copy link
Member

Disable those tests with TaskList#24

@smitpatel smitpatel mentioned this issue May 19, 2019
22 tasks
@roji
Copy link
Member Author

roji commented May 19, 2019

OK, as I've already opened this issue we can use it to track? Added reference from task list.

@ajcvickers
Copy link
Member

@smitpatel @roji This should only happen when "rich data logging" is enabled, right? Also, I'm not sure I agree with throwing different exception types. It makes it more difficult if people are trying to catch these exceptions in one place. (The inner exception should vary, of course, but I think the one we throw should be the same.)

@ajcvickers ajcvickers added this to the 3.0.0 milestone May 20, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, Backlog Jun 28, 2019
@smitpatel smitpatel assigned smitpatel and unassigned roji Mar 20, 2020
@smitpatel smitpatel modified the milestones: Backlog, 5.0.0 Mar 20, 2020
smitpatel added a commit that referenced this issue Mar 20, 2020
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Mar 20, 2020
@ajcvickers
Copy link
Member

Note so that I find this next time I search: this is EnableDetailedErrors.

smitpatel added a commit that referenced this issue Mar 20, 2020
smitpatel added a commit that referenced this issue Mar 21, 2020
@smitpatel smitpatel linked a pull request Mar 21, 2020 that will close this issue
@ajcvickers ajcvickers removed this from the 5.0.0 milestone Mar 31, 2020
@ajcvickers ajcvickers added this to the 5.0.0-preview3 milestone Mar 31, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview3, 5.0.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-3.0 type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants