Add Sentry (#19)

* add sentry

* add sentry

* better log web3proxy

* Add managing and worker on sentry

* better log web3proxy
This commit is contained in:
Oda
2025-04-22 20:49:02 +02:00
committed by GitHub
parent df5f7185c8
commit 42a4cafd8d
40 changed files with 2959 additions and 146 deletions

View File

@@ -22,8 +22,15 @@ namespace Managing.Application.Shared.Behaviours
{
var requestName = typeof(TRequest).Name;
logger.LogError(ex, $"Unhandled Exception for Request {requestName} {request}");
// Log to standard logger with request details
// This will be picked up by the global middleware for Sentry
logger.LogError(ex, "Unhandled Exception for Request {RequestName} {@Request}", requestName, request);
// Add MediatR context to the exception for better tracing
ex.Data["RequestType"] = requestName;
ex.Data["RequestHandler"] = typeof(TRequest).FullName;
// Rethrow to allow global error handling middleware to handle the response
throw;
}
}