Add Sentry (#19)
* add sentry * add sentry * better log web3proxy * Add managing and worker on sentry * better log web3proxy
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user