added Error page to Server Blazor

This commit is contained in:
Isaac Levin 2019-07-01 16:42:02 -04:00
parent 49fe6631b0
commit 3b88d2aa35
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,15 @@
@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 the <strong>Development</strong> environment displays 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

@ -148,7 +148,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();