This repository was archived by the owner on Dec 8, 2018. It is now read-only.
This repository was archived by the owner on Dec 8, 2018. It is now read-only.
UseDeveloperExceptionPage() doesn't work if exception is thrown after starting to write response #281
Closed
Description
The following user code shows the exception page as expected:
app.UseDeveloperExceptionPage();
app.Run(async (context) =>
{
throw new Exception();
await context.Response.WriteAsync("hello");
});
However, the following user code just gets an incomplete response and no exception page:
app.UseDeveloperExceptionPage();
app.Run(async (context) =>
{
await context.Response.WriteAsync("hello");
throw new Exception();
});
In ASP.NET 4.6, I believe we buffer responses (at least by default), so developers get a nice error page almost anywhere an exception is thrown. We may want to do the same in ASP.NET Core, perhaps only when running in debug mode or only when UseDeveloperExceptionPage()
has been called.