Something went wrong. Try again.
Personal website
Something went wrong. Try again.
2.2 kB · 67 lines
at master
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667@* This file is part of NKK.
NKK is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
NKK is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with NKK. If not, see <http://www.gnu.org/licenses/>.*@
@page "/Error"@layout MainLayoutNoNBox@using Microsoft.AspNetCore.Diagnostics@inject IHttpContextAccessor HttpContextAccessor@inject IWebHostEnvironment Env
<AppTitle>OOPSIE WOOPSIE!!</AppTitle>
<div class="tx n-box text-center gap-2"> <h1> <span class="text-6xl">@HttpContextAccessor.HttpContext!.Response.StatusCode</span> <br/> <span class="text-4xl"> @Microsoft.AspNetCore.WebUtilities.ReasonPhrases.GetReasonPhrase( HttpContextAccessor.HttpContext.Response.StatusCode ) </span> </h1> OOPSIE WOOPSIE!! Uwu We made a fucky wucky!! A wittle fucko boingo! The code monkeys at our headquarters are working VEWY HAWD to fix this! <hr thin /> <a href="/" class="clickable p-4">go home......</a></div> @if (Env.IsDevelopment() && ExceptionHandler != null && Ex is not StatusCodeException) {<div class="tx n-box"> <h2>@Ex.GetType(): @Ex.Message</h2> <pre>@Ex.StackTrace</pre> @{ var inner = Ex.InnerException; } @while ( inner != null ) { <h3>(inner) @inner.GetType(): @inner.Message</h3> <pre>@inner.StackTrace</pre> inner = inner.InnerException; } </div>}
@code { private IExceptionHandlerFeature? ExceptionHandler => HttpContextAccessor.HttpContext!.Features.Get<IExceptionHandlerFeature>(); private Exception Ex => ExceptionHandler!.Error;
protected override void OnInitialized() { var triggered = (bool?)HttpContextAccessor.HttpContext!.Items[ExceptionCatchingMiddleware.Name_ItemTriggered]; if (triggered != true) throw new StatusCodeException(404); base.OnInitialized(); }}