-
Notifications
You must be signed in to change notification settings - Fork 10.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
[6.0-rc2] Fix DatabaseDeveloperPageExceptionFilter to handle wrapped DbExceptions #36803
Conversation
Sometimes EF (or other libraries) wrap database errors. The exception filter should account for this, but was not doing. This was revealed by dotnet/efcore#25050 where we started treating more error numbers as transient and hence wrapping their exceptions. Note that the original Diagnostics.EFCore.FunctionalTests have a test for this, but it appears that these tests were never updated when the mechanism was changed in .NET 5.
@javiercn @Pilchie RC2 fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1399210 The database error page won't show when using EF Core 6.0 RC2 without this fix. It doesn't stop anything else working. That is, if the database is created as normal, then everything else should work. So the reason to get this into RC2 is so that people see the error page and get instructions on what to do. |
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.
Looks great!
/cc @AndriySvyryd FYI |
"Hi ajcvickers. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
Description
Sometimes EF (or other libraries) wrap database errors. The exception filter should account for this, but was not doing. This was revealed by dotnet/efcore#25050 where we started treating more error numbers as transient and hence wrapping their exceptions.
Note that the original Diagnostics.EFCore.FunctionalTests have a test for this, but it appears that these tests were never updated when the mechanism was changed in .NET 5.
Customer Impact
When first creating a site and the DB doesn't exist, you get an error message rather than the custom database page that allows you to create it.
Regression?
Regressed since RC1, as EF started wrapping more exceptions in dotnet/efcore#25050
Risk
Just falls back to
InnerException
if the exception isn'tDBException
.Verification
Packaging changes reviewed?
Addresses AzDO#1399210