aspnet / Diagnostics

[Archived] Diagnostics middleware for reporting info and handling exceptions and errors in ASP.NET Core, and diagnosing Entity Framework Core migrations errors. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
213 stars 108 forks source link

Fixes null ref in DatabaseErrorPageMiddleware. #433

Closed anpete closed 6 years ago

anpete commented 6 years ago

Fix aspnet/Home#2820 - UseDatabaseErrorPage throws NullReferenceException when ef exception occur in background task Fix aspnet/EntityFrameworkCore#9599 - Insert entity in non existing table throws NullException

Added null checks to async local access in event callback.

Related to aspnet/Home#2825

anpete commented 6 years ago

Re the design simplification, it turns out that any random database exception can end up here, and we need a way to deduce that it came from EF. Would love to improve this if you have any ideas.

Tratcher commented 6 years ago

Don't they all get wrapped? Can you look for a single wrapper type?

anpete commented 6 years ago

No.