Files
blog.stevanfreeborn.com/src/Blog/Components/Pages/Error.razor
T

35 lines
950 B
Plaintext

@page "/Error"
@using System.Diagnostics
<PageTitle>@PageTitle</PageTitle>
<HeadContent>
<meta name="description" content="@Description" />
<OpenGraph PageTitle="@PageTitle" Description="@Description" />
</HeadContent>
<div class="container">
<h2>Error</h2>
<p>Sorry it's me, not you. It looks like an unhandled error occurred while processing your request.</p>
@if (ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@RequestId</code>
</p>
}
</div>
@code
{
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private const string PageTitle = "Error - journal";
private const string Description = "An unhandled error occurred while processing your request.";
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
}