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

35 lines
950 B
Plaintext
Raw Normal View History

2024-04-02 15:35:57 -05:00
@page "/Error"
@using System.Diagnostics
2024-04-14 16:38:50 -05:00
<PageTitle>@PageTitle</PageTitle>
<HeadContent>
<meta name="description" content="@Description" />
<OpenGraph PageTitle="@PageTitle" Description="@Description" />
</HeadContent>
2024-04-02 15:35:57 -05:00
2024-04-10 01:28:38 -05:00
<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>
2024-04-02 15:35:57 -05:00
2024-04-10 01:28:38 -05:00
@if (ShowRequestId)
{
2024-04-02 15:35:57 -05:00
<p>
2024-04-10 01:28:38 -05:00
<strong>Request ID:</strong> <code>@RequestId</code>
2024-04-02 15:35:57 -05:00
</p>
2024-04-10 01:28:38 -05:00
}
</div>
2024-04-02 15:35:57 -05:00
2024-04-13 19:09:03 -05:00
@code
{
2024-04-10 01:28:38 -05:00
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
2024-04-14 16:38:50 -05:00
private const string PageTitle = "Error - journal";
private const string Description = "An unhandled error occurred while processing your request.";
2024-04-02 15:35:57 -05:00
2024-04-10 01:28:38 -05:00
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
2024-04-02 15:35:57 -05:00
}