Jeremy Pritts ab4c37f68b Replace Electron with a web UI and enable NativeAOT
* Resolves #1123
* Resolves #1097
* Related: #922
2023-12-13 12:25:16 -05:00

22 lines
437 B
C#

using AssetRipper.Import.Logging;
using Microsoft.AspNetCore.Http;
namespace AssetRipper.GUI.Web;
internal sealed class ErrorHandlingMiddleware : IMiddleware
{
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
try
{
await next(context);
}
catch (Exception ex)
{
Logger.Error(ex);
context.Response.Redirect("/"); // Redirect to the main page since we don't have an error page.
}
}
}