Files
pdf-service/PdfService/ExceptionHandlerMiddleware.cs
2025-12-31 17:38:34 +03:30

23 lines
432 B
C#

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);
}
}
}