This commit is contained in:
Dmitrii Kollerov
2026-09-25 08:05:46 +03:00
parent 2b05c26eb3
commit 68da43a673
29 changed files with 867 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
using System;
namespace example_csharp_app;
public class ErrorLogMiddleware
{
private readonly RequestDelegate _next;
public ErrorLogMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext httpContext, IConfiguration configuration)
{
try
{
await _next(httpContext);
return;
}
catch (Exception)
{
// todo: logme
httpContext.Response.StatusCode = 500;
}
}
}