Added sentry support

This commit is contained in:
2025-12-31 17:38:34 +03:30
parent f764776321
commit f3bfa59889
3 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
namespace PdfService;
public class ExceptionHandlerMiddleware
{
private readonly RequestDelegate _next;
public ExceptionHandlerMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context)
{
try
{
await _next(context);
}
catch (Exception ex)
{
SentrySdk.CaptureException(ex);
}
}
}