83 lines
No EOL
2.1 KiB
Text
83 lines
No EOL
2.1 KiB
Text
@page
|
|
@using Iceshrimp.Backend.Core.Configuration
|
|
@using Iceshrimp.Backend.Core.Extensions
|
|
@using Iceshrimp.Backend.Core.Middleware
|
|
@using Microsoft.Extensions.Options
|
|
@model ErrorPageModel
|
|
@inject IOptions<Config.InstanceSection> Instance
|
|
@inject IOptions<Config.SecuritySection> Security
|
|
@{
|
|
// Not meant for direct consumption, use with RazorViewRenderService.
|
|
Layout = null;
|
|
}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>@($"Error {Model.Error.StatusCode} - 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"/>
|
|
<style>
|
|
.float-right {
|
|
float: right;
|
|
}
|
|
</style>
|
|
</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)
|
|
{
|
|
@foreach (var error in errors)
|
|
{
|
|
<strong>@error.Key</strong>
|
|
<ul>
|
|
@foreach (var val in error.Value)
|
|
{
|
|
<li>@val</li>
|
|
}
|
|
</ul>
|
|
}
|
|
}
|
|
@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>
|
|
|
|
@if (Security.Value.ExceptionVerbosity >= ExceptionVerbosity.Debug)
|
|
{
|
|
<pre><code>@Model.Error.Exception.ToString()</code></pre>
|
|
}
|
|
|
|
<footer>
|
|
<strong>Iceshrimp.NET</strong> v@(Instance.Value.Version)
|
|
@if (Model.Error.Exception is PublicPreviewDisabledException)
|
|
{
|
|
<span class="float-right">
|
|
<a href="/login?rd=@(Request.Path.ToString().UrlEncode())">Login</a>
|
|
</span>
|
|
}
|
|
</footer>
|
|
</body>
|
|
</html> |