Iceshrimp.NET/Iceshrimp.Backend/Pages/Shared/ErrorPage.cshtml
2024-09-16 00:53:23 +02:00

65 lines
No EOL
1.5 KiB
Text

@page
@using Iceshrimp.Backend.Core.Configuration
@using Microsoft.Extensions.Options
@model ErrorPageModel
@inject IOptions<Config.InstanceSection> Instance
@{
// Not meant for direct consumption, use with RazorViewRenderService.
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>@("Error - Iceshrimp.NET")</title>
@* ReSharper disable once Html.PathError *@
<link rel="stylesheet" href="~/Iceshrimp.Backend.styles.css"/>
<link rel="stylesheet" href="~/css/default.css"/>
@* ReSharper disable once Html.PathError *@
<link rel="icon" type="image/png" href="~/favicon.png"/>
</head>
<body>
<h2>Error @Model.Error.StatusCode: @Model.Error.Error</h2>
@if (Model.Error.Message != null)
{
<p>
<strong>Message:</strong> @Model.Error.Message
</p>
}
@if (Model.Error.Details != null)
{
<p>
<strong>Details:</strong> @Model.Error.Details
</p>
}
@if (Model.Error.Errors is { Count: > 0 } errors)
{
<p>
@foreach (var error in errors)
{
<strong>@error.Key</strong>
<ul>
@foreach (var val in error.Value)
{
<li>@val</li>
}
</ul>
}
</p>
}
@if (Model.Error.Source != null)
{
<p>
<strong>Source:</strong>
<code>@Model.Error.Source</code>
</p>
}
<p>
<strong>Request ID:</strong>
<code>@Model.Error.RequestId</code>
</p>
<footer>
<strong>Iceshrimp.NET</strong> v@(Instance.Value.Version)
</footer>
</body>
</html>