Merge pull request #12139 from isaac2004/11243-worrk

Added Error page to ServerSide Blazor (#11243)
This commit is contained in:
Ryan Brandenburg 2019-07-16 14:34:33 -07:00 committed by GitHub
commit cf3c2ba02b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,16 @@
@page "/error"
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

View File

@ -144,7 +144,7 @@ namespace BlazorServerWeb_CSharp
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseExceptionHandler("/Error");
#if (RequiresHttps)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();

View File

@ -902,6 +902,7 @@
"Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs",
"Data/Migrations/ApplicationDbContextModelSnapshot.cs",
"Pages/Counter.razor",
"Pages/Error.razor",
"Pages/FetchData.razor",
"Pages/Index.razor",
"Pages/_Host.cshtml",
@ -938,6 +939,7 @@
"Data/WeatherForecast.cs",
"Data/WeatherForecastService.cs",
"Pages/Counter.razor",
"Pages/Error.razor",
"Pages/FetchData.razor",
"Pages/Index.razor",
"Pages/_Host.cshtml",
@ -974,6 +976,7 @@
"Data/WeatherForecast.cs",
"Data/WeatherForecastService.cs",
"Pages/Counter.razor",
"Pages/Error.razor",
"Pages/FetchData.razor",
"Pages/Index.razor",
"Pages/_Host.cshtml",
@ -1009,6 +1012,7 @@
"_Imports.razor",
"Data/WeatherForecast.cs",
"Data/WeatherForecastService.cs",
"Pages/Error.razor",
"Pages/Counter.razor",
"Pages/FetchData.razor",
"Pages/Index.razor",
@ -1045,6 +1049,7 @@
"Data/WeatherForecast.cs",
"Data/WeatherForecastService.cs",
"Pages/Counter.razor",
"Pages/Error.razor",
"Pages/FetchData.razor",
"Pages/Index.razor",
"Pages/_Host.cshtml",
@ -1081,6 +1086,7 @@
"Data/WeatherForecast.cs",
"Data/WeatherForecastService.cs",
"Pages/Counter.razor",
"Pages/Error.razor",
"Pages/FetchData.razor",
"Pages/Index.razor",
"Pages/_Host.cshtml",